国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Home Backend Development PHP Tutorial cakephp Cakephp executes the main process

cakephp Cakephp executes the main process

Jul 29, 2016 am 08:42 AM
cakephp

Load the basic file
cake/basics.php which defines commonly used methods and time constants
$TIME_START = getMicrotime(); records the start execution time
cake/config/paths.php which defines some basic paths
cake/lib/object. The basic class of php cake
cake/lib/inflector.php here mainly deals with singular and plural numbers, underlined naming and camel case naming
cake/lib/configure.php which provides reading and writing of file configuration, path setting, and Method of loading files
cake/lib/cache.php Cache operation
Configure::getInstance(); Start configuring the project
config/core.php Configuration file of the project
config/bootstrap.php Entry file of the project
App ::import('Core', array('Dispatcher')); Load the core and start doing business, GO
$Dispatcher = new Dispatcher();
$Dispatcher->dispatch($url); Start execution, pass For the current URL parsing, if you set up compressed Js and Css, these files will be compressed and output. If you set up a cache for the page, the cached page will be output directly, and finally the corresponding Controller will be found. If it cannot be found, appropriate error handling is performed.
Instantiate the current Controller, determine the view path, instantiate the Component, and obtain the methods of only the current Controller [not including the parent class Controller]
Protect the private methods, methods with admin routing or prefix in the current Controller, and do not allow direct access
Set the basic attributes of 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 the Controller
Execute the __mergeVars method, which performs special merging processing of components, helpers, uses and other attributes of the parent and child classes
Call the Component->init() method to load the series of components (Session) set by the user is the default), and the default enabled attribute is true. (This property can be modified later in beforeFilter)
Call the Component->initialize() method. If there is this initialize method in the series of components and the component's enabled is true, then call the components->initialize method (here the enabled user It seems that it cannot be set through the Controller, it can only be true)
Call the beforeFilter() method in the current Controller, this method is a good thing^_^
Call the Component->startup() method, similarly, if there is this startup method in the series components And if the enabled of the component is true, then the components->startup method is called (enabled here can be set through beforeFilter). This method is also the most important method in components. For example, Auth is here to make a big fuss ^_^
Start execution Action method in the current Controller
If autoRender is set to true, the render() method of the current Controller will be called, otherwise the data returned by the Action method will be returned or output. When calling the render() method of the Controller, first call the render() method of the current Controller. The beforeRender() method
loads the view rendering class
calls the Component->beforeRender() method. Similarly, if there is this beforeRender method in the series of components and the component's enabled is true, the components->beforeRender method is called (here enabled Can be set through beforeFilter)
Get the data validation error information of the current Model and use it for the View
Call the View's render() method
Load the relevant Helper
Call the Helper's beforeRender() method
Call the Helper's afterRender() method
Related Cache processing
Execute the renderLayout() method, of course, you must allow rendering layout, the default is the default.ctp layout file
Call the Helper's beforeLayout() method
Call the Helper's afterLayout() method
Call the Component->shutdown() Method, similarly, if there is this shutdown method in the series components and the component's enabled is true, the components->shutdown method is called (enabled here can be set through beforeFilter)
Execute the afterFilter method in the current Controller, here you can The output content of the view ($controller->output) does some processing and returns or outputs the view data.
The process is completed.
The above introduces the main process of cakephp Cakephp execution, including cakephp content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

CakePHP Working with Database CakePHP Working with Database Sep 10, 2024 pm 05:25 PM

Working with database in CakePHP is very easy. We will understand the CRUD (Create, Read, Update, Delete) operations in this chapter.

CakePHP Project Configuration CakePHP Project Configuration Sep 10, 2024 pm 05:25 PM

In this chapter, we will understand the Environment Variables, General Configuration, Database Configuration and Email Configuration in CakePHP.

CakePHP Logging CakePHP Logging Sep 10, 2024 pm 05:26 PM

Logging in CakePHP is a very easy task. You just have to use one function. You can log errors, exceptions, user activities, action taken by users, for any background process like cronjob. Logging data in CakePHP is easy. The log() function is provide

CakePHP Creating Validators CakePHP Creating Validators Sep 10, 2024 pm 05:26 PM

Validator can be created by adding the following two lines in the controller.

CakePHP Services CakePHP Services Sep 10, 2024 pm 05:26 PM

This chapter deals with the information about the authentication process available in CakePHP.

CakePHP Routing CakePHP Routing Sep 10, 2024 pm 05:25 PM

In this chapter, we are going to learn the following topics related to routing ?

How to create custom pagination in CakePHP? How to create custom pagination in CakePHP? Jun 04, 2023 am 08:32 AM

CakePHP is a powerful PHP framework that provides developers with many useful tools and features. One of them is pagination, which helps us divide large amounts of data into several pages, making browsing and manipulation easier. By default, CakePHP provides some basic pagination methods, but sometimes you may need to create some custom pagination methods. This article will show you how to create custom pagination in CakePHP. Step 1: Create a custom pagination class First, we need to create a custom pagination class. this

CakePHP File upload CakePHP File upload Sep 10, 2024 pm 05:27 PM

To work on file upload we are going to use the form helper. Here, is an example for file upload.

See all articles