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 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.
I hope this article will be helpful to everyone’s ThinkPHP framework programming.