Libraries,helpers,hooks folder description for several files in the CI framework
Source: Unknown Time: 2014-10-20 11:37 read: 117 xbdadmin
Reading guidance 1.library folder if you want to extend the functionality of CI, then put your class library here, note that this folder is composed of class, you can see if loading library notes! 2.helper folders If you need to use some functions to help you ...
1.library folder
If you want to extend the functionality of CI, then put your class library here, note that this folder is composed of class, you can see if loading library notes!
2.helper folder
If you need to use some function to help you do some small functions, then put it, here are the procedural code instead of the class, the general helper is for the view,
Here's how to use it:
$this->load->helper (" filename )
filenameis the file name of the auxiliary function, not including the _helper.php extension. The file name should be saved as: filename_helper.php, placed under the helper folder!
3.hooks folder
Store the hooks you created. Hooks are the control methods used to load other files, and cannot be called by the controller, which is called automatically by the system. When CodeIgniter is running, it produces a special process. Of course, you can customize some of the actions to replace certain stages of the program's running process. For example, you can run a specific script or trigger your script at another time before the controller just loads or just loads.
Seven mount points for CI:
- Pre_system
The early invocation of the system execution. Only when the benchmark and hooks classes have finished loading. No routing or other process is performed.
- Pre_controller
Called before any of your controllers are called. The base class used at this point, routing and security checks are complete.
- Post_controller_constructor
After your controller is instantiated, any method calls are called before.
- Post_controller
Called after your controller is fully operational.
- Display_override
Overrides 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 pass $this->ci =& get_instance () Refer to the CI Super object, and then the final data can be obtained by calling $this->ci->output->get_output () .
- Cache_override
Allows you to call your own function instead of the _display_cache () function in the output class. This allows you to use your own cache display method
- Post_system
After the final coloring page is sent to the browser, the browser finishes receiving the final data at the end of the system execution call
Source: >
From for notes (Wiz)
Several files in the CI framework libraries