Preliminary study on TP

Source: Internet
Author: User

The requirements for the front end are getting higher. Basically, as a front-end people need a background language, so choose the current popular PHP. Because it is self-study for me this does not know the code is still a bit difficult for people.

1. First look at the directory structure of thinkphp

1├─thinkphp.php     Framework Entry file (Note: This file cannot be executed directly until it is called in the project portal file  ) = I thought I was going to point at it. 2├─common Framework common file 3├─conf framework configuration file 4├─ext End Framework Extensions directory 5├─lang Core Language Pack directory 6├─lib core class library directory 7│  ├─behavior core Behavior Class library 8│ ├─core  core base Class library 9│ ├─driver  built-in driver 10│  │< C7/>├─cache built-in cache driver 11│  │  ├─db built-in database driver 12│  │  ├─taglib built-in tag driver 13│  │  └─template built-in template engine driver 14│< C14/>└─template built-in template engine 15└─TPL system template Directory

2. Call the thinkphp Portal file index.php

1 <?PHP2 require '/thinkphp framework directory/thinkphp.php ';  Previously mentioned call entry file

3. Run index.php under the folder app. The file directory is automatically generated because thinkphp.php is called.

1├─index.php     Project portal File 2├─common project Common Files directory 3├─conf project configuration directory 4├─lang Project language directory 5├─lib Project class library directory 6│  ├─action Action class library catalog 7 │  ├─behavior Behavior Class library catalog 8│  ├─model Model Class library catalog 9│  └─widget Widget Class library catalog 10├─runtime Project Runtime catalog 11│  ├─cache Template Cache directory 12│< C6/>├─data Data Cache directory 13│  ├─logs log file directory 14│  └─temp temporary cache directory 15└─TPL project template directory

4. The entry file is moved to the outside of the app directory. Modify the code as follows.

1 <?php2 define (' app_name ', ' APP ');  Define Project name 3 define (' App_path ', './app/');//project directory 4 require '/thinkphp framework directory/thinkphp.php ';

This is the most basic knowledge of getting started. A day to learn a bit will always have an effect!

Preliminary study on TP

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: 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.