Home >Operation and Maintenance >phpstudy >How to use tp5 in phpstudy
phpstudy Steps to install ThinkPHP:
1. Download the ThinkPHP installation package, recommended: php5 download
2. Unzip the downloaded ThinkPHP and copy all files
3. Find the www folder under the phpstudy installation path, create a new tp5 folder, and paste all the unzipped ThinkPHP files into tp5
4. Restart phpstudy
5. Enter http://localhost/tp5/public/
in the browser. 6. It will be displayed as “ThinkPHP V5
ThinkPHP specifications:
1. All directories must use lowercase underscores
2. The function file name must end with .php
3. The namespace must be Consistent with the directory path: php namespace app\index\controller
4. The class library name must be consistent with the file name. The first letter must be capitalized and written in camel case: the file name is Index.php then The class library name must be class Index {...}
5. The function name must have the first letter lowercase and use camel case writing format: pubilc function getUserName(){...}
6. The first letter of the variable name should be lowercase, and the camel case format should be used: public $userName = '';
7. The constructor name should be double lowercase, and this type of file should not be used as much as possible: public function __controll(){.. .}
8. Constants must be in all uppercase letters and connected with underscores: define('APP_STATE','dev');
9. All configuration names must be in all lowercase letters and connected with download lines: 'app_namespace' => 'app',
10. The database or table name must be in lowercase letters plus a download line connection. Camel cases or capital letters are not allowed: user_name
11. Top and The namespace (directory) is uniformly called app, forming a good development method: namespace app\index\controller From the namespace point of view, this path is the path of the directory
The above is the detailed content of How to use tp5 in phpstudy. For more information, please follow other related articles on the PHP Chinese website!