Home  >  Article  >  Backend Development  >  How to combine ThinkPHP public configuration files with configuration files in respective projects, _PHP tutorial

How to combine ThinkPHP public configuration files with configuration files in respective projects, _PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:13:11926browse

How to combine ThinkPHP public configuration files with configuration files in respective projects,

The example in this article describes the method of combining ThinkPHP public configuration files and configuration files in respective projects. Share it with everyone for your reference. The specific implementation method is as follows:

When using ThinkPHP, when laying out the directory, a single entry file is often used to correspond to a project directory. However, when writing configuration files, repeated configuration items are often used in their respective configuration files. This is used The public configuration items will be placed in a public directory.

Specific implementation method:

Use the configuration file feature return array(); which can be defined like this in the configuration file in the respective project:

Copy the code The code is as follows:
$config = array(''=>'',);
Then use the function
Copy code The code is as follows:
return array_merge(include'./conf/config.php',$config);

In this way, you can use the public configuration file in the root directory

I hope this article will be helpful to everyone’s ThinkPHP framework programming.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/917045.htmlTechArticleHow to combine the ThinkPHP public configuration files with the configuration files in their respective projects. This article describes the examples of ThinkPHP public configuration files and their respective projects. How to combine configuration files in a project. Share with everyone...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn