Profiles in 3 Categories: System profiles, grouping profiles, application profiles
① system configuration file thinkphp/conf/convention.php;
② packet/module/platform configuration file home/conf/config.php;
③ application configuration file common/conf/config.php;
(1) Comprehensive case: implementation of OA system login page display
First you need to clarify what conditions are required for the current feature MVC
First, VC
① first is the controller C
Controller: Login log out and put into public, controller name PublicController.class.php
Create the controller file, write the structure code
<? PHP // Declaration of the namespace namespace Admin\controller; // introducing the parent class controller Use Think\controller; // declaring the controller and inheriting the parent class class extends controller{} }? >
② Next is the presentation template, where you'll set the method
Methods: Method Name Login, write method login, display template file login.html
// login Page Show Public function Login () { $this,display ();}
③ the corresponding template file Login.html,v
Copy the template file to the specified location, the specific location of the browser error has been prompted, here prompt location./application/admin/view/public/login.html
<! DOCTYPE html> account:<input type= "text" name= "name" > <br/> Password:<input type= "password" name= "pwd" ><br/> <input type= "Submit" Value= "Login" ></from></body>
④ copy the corresponding static resource file js,css,images to the specified location
Location: root directory, same as application,/public/admin/css or JS or images
⑤ Modifying the introduction path of static resources in template file login.html
This is because the above custom constants __admin__ = __public__/admin, so this can be written
<link rel= "stylesheet" type= "Text/css" href= "__admin__/login.css" >
Equivalent to
<link rel= "stylesheet" type= "Text/css" href= "__public__/admin/login.css" >
Note: In the new version of PHP, even if you do not write methods, you can sometimes display templates. The result can be rendered as long as there is a template with the same name as the method.
Principle: When there is a method, you will first access the method, and then use the template; when there is no method, the template with the same method name will be directly adjusted; If the template does not have a Times error
.
.
Video Learning Transcript---thinkphp---case code