List of available hooks in Code Igniter and their uses

pre_system
First hook in the sequence of seven hooks run by Code Igniter on every request of a web page. Benchmark and hook classes have been loaded at this point. No routes have been run at this time.

pre_controller
Second hook run after the pre_system hook. Routing, security checks have been made and base classes have been loaded. However no controller has been run at this point of time.

post_controller_constructor
Third hook run after pre_controller hook. This hook is called after the constructor of a controller has been called but prior to any method calls happening.

post_controller
Called immediately after your controller is fully executed.

display_override
Overrides the _display() function, used to send the finalized page to the web browser at the end of system execution. This allows you to alter/modify the HTML before sending to the browser. A nice example would be to remove any white space characters from your HTML so that it reduces the size of the HTML.

cache_override
Very useful hook if you want to override the _display_cache() function to display fresh or other information instead of the cache taken by Code Igniter.

post_system
Called after the final rendered page is sent to the browser. You can use this function to cleanup any open files or data in database tables which had served its purpose after the output of the page is sent to the browser.


Please follow and like us:
error

Be the first to comment

Leave a Reply

Your email address will not be published.