Magento MVC Architecture & Flow
There are many systems in PHP that follows MVC (Model-View-Controller) architecture. It is a robust design pattern that separates data access, business logic and user interface code.
A typical MVC concept,
Model: consists of application data and business rules. It communicates with the database get the information. In Magento, we have these files under “Model” folder of each module in any code pool be it core, local or community.
Controller: mediates input, converting it to commands for the model. These files decides action between model and view files. They can be found under “controllers” folder of each module in core, local or community code pool.
View: output representation of data like rendered HTML. In Magento, these files resides under template at app/design and have .phtml extension. These files have combination of PHP and HTML code as well as $this object to refer to Model for data structure.
But Magento is based on more abstract MVC pattern. Refer the below diagram
Description:
- URL is taken by a single PHP file and Magento application is instantiated
- Application instantiate Front Controller Object
- Front Controller instantiate Routers
- Routers check URL and determines Controller and Actions
- Action Methods manipulate Models
- Action loads layout and kicks off rendering
- Templates, via Blocks, read from Models
- Blocks and Child Blocks render into HTML page
Note: Unlike other MVC patters, Magento Blocks refer to the Models for their data as Action Controller does not pass them data structure.
I loved as much as you will receive carried out right here.
The sketch is tasteful, your authored subject matter stylish.
nonetheless, you command get bought an shakiness over that you wish be delivering the
following. unwell unquestionably come further formerly
again since exactly the same nearly very often inside case you shield this hike.
Feel free to surf to my blog august birthstone (Jewel)