How to autoload helper functions in codeigniter 4 |
In the Controller docs it shows that you can use the helpers class property to have it loaded on a per-controller basis. If you want something loaded on every request, currently your best option is to use a base controller like InsiteFX mentioned. Though, you'd want to be careful you didn't overwrite any per-controller helpers:
Code: class BaseController extends \CodeIgniter\Controller Or, even simpler, just load the helper in the BaseController constructor: Code: class BaseController extends \CodeIgniter\Controller |
Messages In This Thread |
How to autoload helper functions in codeigniter 4 - by geordy - 01-21-2017, 07:55 AM
RE: How to autoload helper functions in codeigniter 4 - by enlivenapp - 01-21-2017, 10:36 AM
RE: How to autoload helper functions in codeigniter 4 - by InsiteFX - 01-21-2017, 12:47 PM
RE: How to autoload helper functions in codeigniter 4 - by kilishan - 01-22-2017, 09:09 AM
|