1.library folder
If you want to extend the function of CI, then put your class library here, note that this folder is composed of class, you can see if loading the library notice!
2.helper folder
If you need to use a few functions to help you do some minor functions, then put it on, it's all procedural code instead of class, and the general Helper is for view,
Use the following methods:
Copy Code code as follows:
$this->load->helper (' filename ')
FileName is the file name of the auxiliary function, excluding the _helper.php extension. The filename should be saved as: filename_helper.php, put it under the helper folder!
3.hooks folder
Store the hooks you created. Hooks are used to load other files of the control method, can not be called by the controller, the system is automatically invoked. When CodeIgniter
After running, it will produce a special process.
Of course, you can customize some of the actions to override certain stages of the program's operation. For example, you can run a specific script before the controller has just loaded or just load, or at other times to trigger your script.
Seven mount points for CI:
Pre_system
An earlier call that was performed by the system. Only when the benchmark and hooks classes have finished loading. No routing or other process is performed.
Pre_controller
Call before calling any of your controllers. The base class used at this time, routing and security checks are complete.
Post_controller_constructor
Called before any method calls after your controller is instantiated.
Post_controller
Called after your controller is fully operational.
Display_override
Overwrite the _display () function to send the final page to the Web browser at the end of the system execution. This allows you to display it in your own way. Note that you need to refer to CI Super objects through $this->ci =& get_instance (), Such final data can then be obtained by calling $this->ci->output->get_output ().
Cache_override
Lets you call your own function to replace the _display_cache () function in the output class. This allows you to use your own caching display method
Post_system
After the final coloring page is sent to the browser, the browser receives the final data at the end of the system execution call
About the use of hooks, the manual has a detailed use of instructions, screenshots are as follows: