The following is an introduction to the ThinkPHP deployment directory from the thinkphp framework tutorial column. I hope it will be helpful to friends in need!
1. Problem: I was very confused about the directory structure when writing the project according to the deployment directory instructions in document 2.2.3
2. Solution: (Officially gives two deployment solutions)
1. Official recommendation Solution
Official recommended solution: (Table of contents as shown below)
#Operation Steps:
1.1 Download the ThinkPHP software package, create a new TESTAPP directory, and put the ThinkPHP folder into the TESTAPP folder.
1.2 If necessary Create the front-end directory Home and the back-end directory Admin, and create a new entry file index.php in the TESTAPP folder (used to create the Home directory). The code is as follows:
Copy after login
Copy after login
When you see the Welcome to thinkPHP prompt, the directory structure is as shown in the figure:
Deployment Finish.
1.5 Start writing code
If you need a User controller, create a new UserAction.class in the Admin folder. php, write the following code:
##user=M('user')->select();
$this->display();
}
}
Create a new folder Home in tpl, create a new File index.html, write the following code:
##
Configure database information in config.php in Conf in the Admin folder Enter the URL http://localhost/TESTAPP/admin.php/User/index, you can see the results2. Group module solution (will be added after testing)
The above is the detailed content of Learning: ThinkPHP deployment directory. For more information, please follow other related articles on the PHP Chinese website!