Thinkphp inside will be based on the current? URL to parse the modules and actions to be performed. The return analysis work is implemented by the URL scheduler, the official built-in dispatcher class to complete the schedule. In the dispatcher scheduler, it is based on the
Http://domainName/appName/moduleName/actionName/params
To get the currently required projects (APPNAME), modules (ModuleName) and Operations (ActionName), under certain circumstances, AppName can be unwanted (usually the homepage of the site, because the project name can be specified in the portal file, in which case AppName will be replaced by the import file), in addition to different URL mode settings system will be different intelligent identification.
In fact, the index operation of the index module of the MyApp project is located, because the system executes the default module and operation when the module and operation are not specified, which is the index module and the index operation in the custom configuration of thinkphp. So the following URLs and the above results are the same:
http://localhost/myApp/index.php/Index/index/
With the project configuration parameters, we can change this default configuration.
The system also supports teaming mode and URL routing, which can bring different experiences of URLs.
Analysis of the execution process of the first instance in thinkphp:
First the program entry is the index.php file under MyApp, where require (Think_path. " /thinkphp.php ") is a call to thinkphp.php that contains the commonly used configuration debugging information, then the program will be executed from App::run (), start execution, find the required class, the related file is the default Lib/action directory under the class you declared, Because thinkphp is judged by the name of the class, if you write a class then the format should be: **.class.php format. If the related class is found, the index () function in the class is not specified by default.
The URL pass for the above procedure is: Http://localhost/Myapp/index.php/index/index
Where index.php is the entry file, then index is the class of the index name you defined, and the last index is the index method in the index class you defined.