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