thinkphp-Configuration item structure

Source: Internet
Author: User

To configure the project structure:

If the project is divided into front and rear use.

The most critical of all is the use of public profiles, the most important of which is the partitioning of public parts files.

Here is how to bring up the public part of the front and back projects.

The first is the other public folders:

    • This is the most top-level file configuration.

    • For a detailed catalogue description, see below:
e:\php\www\thinkphp│admin.php//Background main portal file│index.php//Front Desk main entrance file├─admin//Background Folder│├─common│├─conf//Background Configuration folder││config.php//Background configuration file│├─lang│├─lib│├─runtime│└─tpl├─common//Public Programs Folder├─config//Public Configuration Folder│config.php//Public configuration file├─home//Foreground folder│├─common│├─conf//Foreground Configuration Folder││config.php//Foreground configuration file│├─lang│├─lib│├─runtime│└─tpl├─public//public folder folders, storing files such as Css,js,images│├─css│├─images│└─js├─thinkphp//thinkphp Core File└─uploads//Public upload file

Key points: Use of public profiles:

    • The first is the contents of the comman/config.php file:
    • These configurations are public configuration items,
<?PHP/** * Public config file*/returnArray (//Configuration Database-Compact mode    'Db_prefix'='Tp_',    'Db_dsn'='Mysql://root:[email protected]:3306/test',        //to turn on Page_trace mode, first open debug mode at the Portal file    'Show_page_trace'=TRUE,//Modify left and right delimiters    'Tmpl_l_delim'='<{',    'Tmpl_r_delim'='}>',            //Replace system path    'tmpl_parse_string'=Array (//JS public Folder        '__css__'= = __root__.'/public/css',        //CSS Public Folder        '__js__'= = __root__.'/public/js',        //Picture public Folder        '__images__'= = __root__.'/public/images',        //Upload Folder        '__uploads__'= = __root__.'/uploads/',    ),            //Modify the URL case configuration    'url_case_insensitive'=true,    );

Then, the foreground configuration file:

<? PHP /*  */'./config/config.php'; $selfConf array    ( // ' Config item ' = ' config value ',     ); return array_merge ($publicConf, $selfConf);

Next is the background configuration file:

<? PHP /*  */'./config/config.php'; $selfConf array    ( // ' Config item ' = ' config value ',     ); return array_merge ($publicConf, $selfConf);

This way, if the public configuration items used by the front and back tables are placed in the comman/config.php file.

Front Desk-specific configuration is placed in the foreground, the background is unique configuration in the background.

thinkphp-Configuration item structure

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.