thinkphp Modify Project Structure

Source: Internet
Author: User
Tags define root directory

It's sheer idleness--! , the previous two days have been studying Dede, gave up. Boredom recently prepared to study thinkphp, but thinkphp generated the structure of the directory I am very depressed, the individual or more like the Dede of the kind of relatively simple structure, so today to do a change. Now share it out for everyone.

1. First modify the build project directory of the main structure, this does not need to modify the thinkphp source (can also be modified, if it is a beginner, it is best not to modify the)

Create a new index.php entry file, and then create a new project without following the manual. Enter the following code;

$root =dirname (__file__);
$root =str_replace (' \ \ ', '/', $root);
Define (' __root__ ', $root);           Site root directory
define (' Lib_path ', __root__. ') /libs/');
Define (' Conf_path ', __root__. /config/');   Configuration file directory
define (' Lang_path ', __root__. ') /lang/');     Language directory
define (' Tmpl_path ', __root__. ') /templates/');        Directory file
define (' Html_path ', __root__. ') /a/');            Generate static page directory
define (' Runtime_path ', __root__. ') /cache/');      Cache directory
define (' Log_path ', Runtime_path. ') /log/');
Define (' Temp_path ', Runtime_path. /temp/');   
Define (' Data_path ', Runtime_path. /data/');
Define (' Cache_path ', Runtime_path. /cache/');
Define (' App_debug ', true);          Open debugging
require_once ' core/thinkphp.php ';

This allows you to generate a directory. The basic structure is

I renamed the thinkphp folder as core.

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.