Home  >  Article  >  Backend Development  >  Mapping analysis of public function paths and configuration item paths in ThinkPHP, thinkphp function_PHP tutorial

Mapping analysis of public function paths and configuration item paths in ThinkPHP, thinkphp function_PHP tutorial

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

Mapping analysis of public function paths and configuration item paths in ThinkPHP, thinkphp function

This article analyzes the mapping of public function paths and configuration item paths in ThinkPHP through examples. Share it with everyone for your reference. The specific analysis is as follows:

When using public functions in ThinkPHP (a single entry file corresponds to an independent project), you can write a public function file in the Common folder. The file named common.php will be automatically loaded by the system. If it is written as other The function name will not be automatically loaded, but there are two processing mechanisms

1. Manually load load('@.function') when using it; this will manually load the file. @ means it is in the Common folder under this project.

2. Configure

in the configuration file. Copy the code The code is as follows:
'LOAD_EXT_FILE' => 'function'

In ThinkPHP, __PUBLICC__ is not a constant, but a mapping. The default is the Public directory in the root directory. It can be modified in the configuration file.

Copy code The code is as follows:
'TMPL_PARSE_STRING' => __ROOT__.'Public'

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

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/916056.htmlTechArticleMapping analysis of public function paths and configuration item paths in ThinkPHP, thinkphp function This article analyzes the public function paths in ThinkPHP with examples and configuration item path mapping. Share it with everyone for 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