Certificated magento

2.6) Describe URL structure/processing in Magento

 -URL structure in Magento

A link in Magento has format as below:
 
https://user:password@host:443/base_path/[base_script][storeview_path]route_name/controller_name/action_name/param1/value1?query_param=query_value#fragment 
 
•User:password@host:443/base_path/[base_script]:
 
the path to the Script file which 
runs Magento. Usually, it is an index.php file.
•[storeview_path]: store view code will display here. According to the configuration, 
this storeview_path is inserted into the link or not.
•route_name/controller_name/action_name: the path to the action which is run by the 
request of this link.
•param1/value1: name and value of the parameter for the request that is provided by 
the link.
•?query_param=query_value#fragment: query
 
-URL processing in Magento
 
With the link the same as above, when you request it to run into the index.php file  firstly, and then the following files:
 
•app/Mage.php (Mage::app()->run())
•app/code/core/Mage/Core/Model/App.php
•Init and Dispatch controller ($this->getFrontController()->dispatch());
•app/code/core/Mage/Core/Controller/Varien/Front.php
•Chose the router match for dispatch ($router->match($this->getRequest()))
• app/code/core/Mage/Core/Controller/Varien/Router/Admin.php
• app/code/core/Mage/Core/Controller/Varien/Router/Standard.php
• …
• app/code/core/Mage/Core/Controller/Varien/Router/Default.php
•app/code/core/Mage/Core/Controller/Varien/Action.php
• Call Action function (Example: indexAction())
•Custom Controller/Action
•(app/code/core/Mage/Core/Controller/Response/Http.php)
 
The link process is primarily conducted in routers (the detail is the function  match($request). This function will analyze URL to find out the action to call. When  discovering the action, the system will leave the control authority to this action. After  carrying out, the action will return the control authority to the system. And then the  system returns the response content of that link.

 

0 Bình luận

Trở về
  • 1.12) Set up a cron job
  • 1.12) Set up a cron job

    Let’s start with server setup.   As any complex system, Magento has a lot of tasks that need to be executed...