ThinkPHP framework construction
|
The ThinkPHP framework is built. if you need it, you can refer to it.
Set up the controller environment:
Define ('app _ path', './Application/') automatically creates an Application folder and stores the environment in this folder.
Require './ThinkPHP. php'; run the TP framework Create a controller:
1. storage location: in the Controller folder
2. naming convention: Controller name + Controller. class. php
3. class name and file name have the same name
4. Use Pascal's name method (big hump)
5. case sensitive,
6. THinkPHP uses UTF-8 encoding by default. ThinkPHP has four routing methods: 1. normal mode http: // localhost/index. php? M = Group & c = controller & a = Method 2. pathinfo mode http: // localhost/index. php/group/controller/method
3. rewrite mode 4. compatibility mode http: // localhost/index. php? S =/group/controller/method
ThinkPHP template:
1. store it in the view folder.
2. a controller corresponds to a folder, and a method corresponds to a template.
System constant/php-weizijiaocheng-313825.html: current path _ CONTROLLER __: current CONTROLLER path _ MODULE __: current Group path _ ACTIOM __: current method path/index. php/Article is equivalent to _ CONTROLLER _ (but it can only be used in the template. that is, it cannot be used in the php file)
|
ThinkPHP