: This article mainly introduces the execution process of Magento ?, If you are interested in the PHP Tutorial, refer. The execution process of Magento can be fully described in a diagram.
Magento is also a mvc program, but it is different from the common mvc structure.
We can see the execution process of his program through one of its registrations:
First, enter http: // localhost/magento/index. php/customer/account/create/in the address bar to enter the registration page.
Step 1: The app/code/core/Mage/customer module is automatically located at the Customer in the url obtained by the program.
Step 2: The account obtained by the program will be automatically located in the controller file app/code/core/Mage/Customer/controllers/AccountController. php
Step 3: If the program obtains "create", The createAction () method is found in the controller file.
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 in the app/design/frontend/base/default/layout/directory. Then, find Label
Customer Account Registration Form
page/1column.phtml
Form Fields Before
Step 5: In customer. the block and template to be used are defined in 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 in the template file to compile the class method.
Therefore, the execution process of the magento program can be summarized as follows:
Get execution controller-> Process business logic and model data in execution method-> controller instantiate layout object-> layout object instantiate block according to request-> block and template one-to-one matching to complete the display logic.
What is the execution process of Magento ?, Including some content, hope to be helpful to friends who are interested in PHP tutorials.