CodeIgniter Forums
Loading helper before controller - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=31)
+--- Thread: Loading helper before controller (/showthread.php?tid=77409)

Pages: 1 2


RE: Loading helper before controller - someone - 10-01-2020

(10-01-2020, 02:22 PM)InsiteFX Wrote: I think what you want there are controller filters.

Thanks. I didn't know that. Really helped me. <3


RE: Loading helper before controller - MGatner - 10-03-2020

Helpers that I want globally available I generally load via the pre_system Event. See app/Config/Evebts.PHP
If you just need it for a specific controller or two the solution above is fine. I typically extend the initController event and add it there. If you could also call Controller::loadHelpers() from the constructor if you needed to handle things then.