If CodeIgniter has _remap() that gets called before it touches any method in a controller, is there an after-method equivalent that gets called after a method is called?
The scenario is that
- one usually pre-checks stuff like login credentials in either the constructor or remap of that controller. this is the pre-method area.
- After that, one builds the page data inside a method.
- Then one loads and displays a view/template by calling the template parser or loading a view.
I would like to have that third step automated in somewhat an automatic after-method function which can be inherited by all my controllers so i won’t have to call the parser/loader every time i make a method?
Codeigniter got a feature called “hooks“. I’m sure that’s what you looking for.
From the hooks page;
The following is a list of available hook points.