CodeIgniter Forums
How to autoload helper functions in codeigniter 4 - 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: How to autoload helper functions in codeigniter 4 (/showthread.php?tid=85943)



How to autoload helper functions in codeigniter 4 - MitchelBrayon - 12-22-2022

I just downloaded CodeIgniter 4 from their official GitHub. They changed a lot from CodeIgniter 3. I want to use base_url() function in the view and for that, you need to load URL helper and in CodeIgniter 3 I autoloaded it in config/autoload.php file. But now they have entirely changed the structure of config/autoload.php file in CodeIgniter 4 and it is very confusing to me.

You can still use the base_url() function in your views in CodeIgniter 4 by using below code in your constructor of controller helper('url');

If anybody who used CodeIgnter 4 knows how to autoload helper functions like url by modifying config/autoload.php file please help me.


RE: How to autoload helper functions in codeigniter 4 - kenjis - 12-22-2022

Wait for v4.3.0 comming soon.
See https://github.com/codeigniter4/CodeIgniter4/blob/4.3/user_guide_src/source/changelogs/v4.3.0.rst#helpers-and-functions


RE: How to autoload helper functions in codeigniter 4 - superior - 12-22-2022

(12-22-2022, 05:15 AM)kenjis Wrote: Wait for v4.3.0 comming soon.
See https://github.com/codeigniter4/CodeIgniter4/blob/4.3/user_guide_src/source/changelogs/v4.3.0.rst#helpers-and-functions

Did not see that one coming, good to know!


RE: How to autoload helper functions in codeigniter 4 - InsiteFX - 12-23-2022

@kenjis, Aw I see that our great CodeIgniter 4 Development Team has been hard at work again!

Thank you CodeIgniter 4 Development Team.