Magento the execution process?

Source: Internet
Author: User
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.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.