Magento The implementation process, a picture can be fully explained.
Magento is also a program of the MVC pattern, but differs from the normal MVC structure.
We look at his program execution process through one of its registrations:
First, we enter http://localhost/magento/index.php/customer/account/create/in the Address bar to enter the registered page.
Step 1: The program gets the URL of the Customer will be automatically positioned to the module App/code/core/mage/customer
Step 2: Then the program gets the account will be automatically located to the controller file app/code/core/mage/customer/controllers/accountcontroller.php
Step 3: The program gets create, the CreateAction () method will be in the controller file just found.
public function createAction(){ if ($this->_getSession()->isLoggedIn()) { $this->_redirect('*/*'); return; } $this->loadLayout(); $this->_initLayoutMessages('customer/session'); $this->renderLayout();}
Step 4: Execute the program to load the Customer.xml under directory app/design/frontend/base/default/layout/. Then look for a label named
customer account Registration Form !--mage_customer-->
page/1column.phtml
Form fields before
Step 5: Define the Block and template to use in Customer.xml, the corresponding file directories are: app\code\core\mage\customer\block\form\register.php and app\ Design\frontend\base\default\template\customer\form\register.phtml
You can use $this to access the methods of a class in the template file.
So, Magento's program execution process can be summed up like this:
Get execution controller--Execute method in handle business logic and model data, controller instantiation layout Object--layout object based on request instantiation Block->block and template one by one correspond to complete display logic.
The above describes the implementation process of the Magento, including the aspects of the content, I hope to be interested in PHP tutorial friends helpful.