Mvc:model model Model (data) Layer View View Layer Controller controller Logic layer
M: Operational data (data connection, data access)
V: Provide display template
C: Implementing Business logic
MVC: Conventions are better than configuration
Action: The method that is placed inside the controller
Previously accessed by: Access to specific pages
How MVC accesses: access to operations under the Controller (method), not a specific page
Access:
4 in the way:
- HTTP//URL/index.php?m=xx&c=xx&a=xx basic get mode
- http :// /index.php/ module / controller / operation method Path mode PathInfo
- http : / /module / controller / operation method rewrite Rewrite mode
- http// URL /index.php?s=/ module / controller / method Compatibility mode
How the controller is defined
1<?PHP2namespace Home\controller;//Define Namespaces3 UseThink\controller; Use parent class controller 4 classIndexcontrollerextendsController5 {6 Public functionLogin ()//Defining Methods7 {8 $this->display ();//using Templates9 }Ten One Public functionShuchu () A { - Echo"Educational Administration System"; - } the -}
How templates are used:
Template (. html file) to be placed under the view file create a new folder with the same name as the controller
Thinkphp Framework Foundation