In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly explains "how to understand the libraries,helpers,hooks folder in the CI framework". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to understand the libraries,helpers,hooks folder in the CI framework".
1.library folder
If you want to extend the functionality of CI, then put your class library here, note that this folder is made up of class, you can see how to load library!
2.helper folder
If you need to use some functions to help you complete some small functions, then put it, here are procedural code rather than classes, generally helper is used for view
The method of use is as follows:
The copy code is as follows:
$this- > load- > helper ('filename')
Filename is the file name corresponding to the helper function, excluding the _ helper.php extension. The file name should be saved as: filename_helper.php, under the helper folder!
3.hooks folder
Store the hooks you created. The hook is a control method used to load other files, which can not be called by the controller, but is called automatically by the system. When CodeIgniter
After running, it produces a special process.
Of course, you can customize some actions to replace some stages in the running of the program. For example, you can run a specific script just before or just after the controller is loaded, or trigger your script at other times.
Seven mount points for CI:
Pre_system
Early calls performed by the system. Only when the benchmark and hooks classes are loaded. No routing or other processes are performed.
Pre_controller
Called before calling any of your controllers. The basic classes, routing and security checks used at this time have been completed.
Post_controller_constructor
After your controller is instantiated, it is called before any method call.
Post_controller
Called after your controller is fully running.
Display_override
Overrides the _ display () function, which is used to send the final page to the web browser at the end of system execution. This allows you to show it in your own way. Note that you need to reference the CI super object through $this- > CI = & get_instance (), and then the final data can be obtained by calling $this- > CI- > output- > get_output ().
Cache_override
It allows you to call your own function to replace the _ display_cache () function in the output class. This allows you to use your own cached display method
Post_system
After the final shading page is sent to the browser, the system in which the browser receives the final data executes the last call
With regard to the use of hooks, there are detailed instructions in the manual. Screenshots are as follows:
Thank you for your reading, these are the contents of "how to understand the libraries,helpers,hooks folder in the CI framework". After the study of this article, I believe you have a deeper understanding of how to understand the libraries,helpers,hooks folder in the CI framework, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.