With thinkphp built a website, sub-foreground and backstage (item no group), there are two entrances, front entrance index.php backstage entrance admin.php
I would like to ask, foreground and background common functions, such as how to load, such as the foreground and background will use time function, all about the time function is placed in a lib_time.php this file, how to load the file when the system is running, not when the load
Reply to discussion (solution)
Usually the site has a config file, loaded on the inside can be
Adding in the configuration file
"Load_ext_file" = "User"
Through the above settings, it will be executed automatically load the project public directory common the following extension function library file user.php, so you can directly in the project to call the extension function library user.php function, and the Extension function library function modification is in real time.
Or you can write directly to the common.php file under the Cmmon folder
Write the method directly in the common/commnet.php, the program runs, will automatically load this file, call, the direct method name can be.
Thank you for your help, gave me a big hint, I put the public files loaded in the thinkphp/common/runtime.php, because in the Lib_common the front and back of the public files used in the definition of functions used to C () and M (), Like the execution of these functions are placed in the runtime.php Think::start ();
Adding in the configuration file
"Load_ext_file" = "User"
Through the above settings, it will be executed automatically load the project public directory common the following extension function library file user.php, so you can directly in the project to call the extension function library user.php function, and the Extension function library function modification is in real time. "Load_ext_file" and "User" This section is used in the project configuration file, if the foreground and backstage are used in the user.php function, that can not be user.php copy two copies, put to the front desk and backstage of the two items common/under each other, Do you want to write two copies of the configuration file?