1. The development mode of thinkPHP5.0.
ThinkPHP uses the MVC pattern , which enforces separation of application input, processing, and output. Applications using MVC are divided into three core components:
Model (Model), View (View), Controller (Controller) , they each handle their own tasks.
1) The embodiment of MVC in thinkPHP5.0
1. M model Model
path: C:\AppServ\www\tp5\application\index\model
Role: Perform database-related processing
2. V view
path: C:\AppServ\www\tp5\application\index\view
Function: It is actually a page
3. C Controller controller
path: C:\AppServ\www\tp5\application\index\controller
Role: Mainly responsible for the entire logic operation
2) Deformation of MVC
1.
The main function of MC model and controller: for interface development
2.
The main function of VC view and controller: single-page website
2. Architecture (URL parsing, entry file, application directory)
1. URL analysis
http://www.tp.com /index.php /Index /Index /indexProtocol
domain name entry file module controller method
2. Entry file
1), file address
C:\AppServ\www\tp5\public\index.php
2), role:
responsible for the entire TP request
3. Application directory
1), application address
C:\AppServ\www\tp5\application
2), role:
an application represents a website