• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Loading helper before controller

(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

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.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.