Cake performs major process _php skills

Source: Internet
Author: User
Load basic Files
Cake/basics.php defines the usual methods and time constants.
$TIME _start = Getmicrotime (); Record Start execution time
cake/config/paths.php defines some basic paths inside
Basic classes of cake/lib/object.php cake
Cake/lib/inflector.php here is mainly dealing with a single plural, with the naming and the hump-naming
cake/lib/configure.php provides file configuration read-write, path setting, and method of loading files
cake/lib/cache.php Cached operations

Configure::getinstance (); Start the configuration of the project
Configuration file for config/core.php project
Entry file for config/bootstrap.php project

App::import (' Core ', Array (' Dispatcher ')); Load core, start doing the right thing, go
$Dispatcher = new Dispatcher ();
$Dispatcher->dispatch ($url); Start execution, through the current URL resolution, if you set the compression JS, CSS, the file compression output, if you set the page cache, direct output cache page, and finally find the corresponding controller. If it is not found, the error is handled accordingly.
Instantiates the current controller, determines the view path, instantiates the component, and obtains a method that only the current controller[does not contain the parent class controller]
Protects against private methods in the current controller, with admin routing, or with prefix methods, and does not allow direct access
Sets the basic properties for the current controller, such as base, here, Webroot, plugin, params, action, Passedargs[array_merge ($this->params["Pass"],$ this->params[' named '])]
Call the Constructclasses method in controller
Executes the __mergevars method, which deals with special merging of attributes such as components, helpers, uses, and so on for a parent-child class
The Component->init () method is invoked to load the user-set series components (session is default) and the default Enabled property is True. (This property can be modified later in Beforefilter)
Call the Component->initialize () method, if the Initialize method is in the series components and the component is enabled to be true, call the components-> Initialize Method (the enabled user here does not seem to be able to pass the controller setting, only true)
This method is a good thing to call the Beforefilter () method in the current controller ^_^
Call the Component->startup () method, similarly, if this startup method is in the series components and the component is enabled to be true, call the components-> The startup method, which can be set by Beforefilter, is also the most important method in components, such as Auth's writing here ^_^
Start executing the action method in the current controller
If set Autorender to True, returns or outputs the returned data of the action method, based on the render () method that invokes the current controller
When you call the controller render () method, you first call the BeforeRender () method in the current controller
Load view Render Class
Call the Component->beforerender () method, similarly, if the BeforeRender method is in the series components and the component is enabled to be true, call the components- >beforerender method (enabled here can be set by Beforefilter)
Gets the data validation error message for the current model, which is used for view
Call view's render () method
Load related Helper Assistant
Invoke Helper's BeforeRender () method
Invoke Helper's AfterRender () method
Related Cache handling
Execute Renderlayout () method, of course, if you want to allow rendering layout, default is DEFAULT.CTP layout file
Invoke Helper's Beforelayout () method
Invoke Helper's AfterLayout () method
Call the Component->shutdown () method, similarly, if the shutdown method is in the series components and the component is enabled to be true, call the components-> Shutdown method (enabled here can be set by Beforefilter)
Execute the Afterfilter method in the current controller, where you can do some processing on the output of the view ($controller->output)
Returns or outputs the view data.
Process complete.

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.