How do I load common functions at the front and back ends of thinkphp? A website is built with thinkphp, which is divided into the front-end and backend (the project is not grouped). There are two portals, the front-end entry index. php & nbsp; background Portal & nbsp; admin. php I would like to ask how to load common functions at the front and back ends. for example, time functions are used at the front and back ends. All time functions are stored in the lib_time.php file, & how do nbs thinkphp frontend and backend public functions be loaded?
A website is built with thinkphp, which is divided into the front-end and backend (the project is not grouped). There are two portals, the front-end entry index. php backend entry admin. php
I would like to ask how to load common functions at the front and back ends. for example, time functions are used at the front and back ends, and all time functions are stored in the lib_time.php file, how can I load this file while the system is running, instead of loading it when it is used?
Share: More
------ Solution --------------------
Generally, the website has a config file, which can be loaded.
------ Solution --------------------
Alternatively, you can directly write it to the common. php file under the library on folder.
------ Solution --------------------
Directly write the method in Common/commnet. php. when the program runs, the file will be automatically loaded, and the method name can be called directly.