The following tutorial column will introduce the thinkphp framework execution process to you in the thinkphp tutorial column. I hope it will be helpful to friends in need!
thinkphp framework execution process
First of all, let’s summarize the general process of framework execution:
index.php-> Load the framework->Read configuration items->Generate application->Load classes->Frame new methods of these classes->Template rendering display;
Specific classes And the file is as follows:
--> index.php (entry, debug mode, application path)
--> ThinkPHP.php (definition path and access mode)
--> Think\Think (class loader, exception handling, reading shared configuration)
--> Think\App (request url scheduling parsing, execution scheduling parsing results)
--> exec executes the Action method of the user-defined Controller
--> Think\Dispatcher (parses M, C, A and parameters according to the url pattern, and loads the module configuration)
--> Think\Controller (calling view, packaging and redirection)
As you can see, the internal process of the framework is actually relatively simple, and there are two very important classes:
Think\Hook: Monitor each stage of App, Action, and View, and execute Behavior
Think\Behavior: Configurable (configuration file) can be added and deleted (code)
Recommended : The latest 10 thinkphp video tutorials
The above is the detailed content of Entry-level introduction to thinkphp framework execution process. For more information, please follow other related articles on the PHP Chinese website!