ThinkPHP Development Series 1 Framework build _ PHP Tutorial-php Tutorial

Source: Internet
Author: User
ThinkPHP Development Series 1 framework. In the initial stage, we only need to download one core package. We cannot use the extension package for the moment. we will download it later. Put the downloaded and decompressed ThinkPHP folder into the root directory of the project we created. at the beginning, we only need to download the core package. We cannot use the extension package for the moment. we will download it later. The downloaded and decompressed ThinkPHP folder is placed in the root directory of the project we created. We know that our project requires the front-end and back-end. First, create the Home and Admin folders.
When we deploy a website, the directory structure is often complicated due to the complexity of the project. The recommended deployment directory structure is as follows:

Directory/file description
ThinkPHP system directory (the following directory structure is the same as the system directory above)
Public website Public Resource Directory (stores Css, Js, images, and other resources of the website)
Upload Directory of the Uploads website (unified directory for user Uploads)
Home Project Directory (the following directory structure is the same as the application directory)
Admin background Management Project directory
...... More project directories
Index. php project Home entry file
Admin. php project Admin entry file
...... More project entry files

The grouping module can be simplified to a project directory.

Directory/file description
ThinkPHP system directory (the following directory structure is the same as the system directory above)
App project directory (the group directory structure will be described later)
Public website Public Resource Directory (stores Css, Js, images, and other resources of the website)
Upload Directory of the Uploads website (unified directory for user Uploads)
Index. php website entry file

The template file of the project is still placed under the Tpl Directory of the project, but the resource files for external calls, including image JS and CSS, are uniformly put under the Public directory of the website, storage in Images, Js, and Css sub-directories. if possible, you can even store these resource files in an external server for remote calls and optimization.
Here we select the second directory method. ThinkPHP requires an entry file, that is, index. php under the Project root directory. Content: // define the project name

// Define the project name
Define ('app _ name', 'app ');
// Define the project path
Define ('app _ path', './APP /');

/* Data Directory */
Define ('egojit _ DATA_PATH ','./data /');

/* Configuration file directory */
Define ('conf _ path', Egojit_DATA_PATH. 'config /');
// Load the framework input file
Require './ThinkPHP. php ';

The reason for choosing this group Directory is mainly because I think this group Directory is simpler and clearer. In this way, we request this website and you will find that many directories are automatically generated under the app directory. If it succeeds, you will see the picture


Bytes. We cannot use the extension package for the moment. we will download it later. Put the downloaded and decompressed ThinkPHP folder to the root directory of the project we created...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.