Welcome Guest, Not a member yet? Register   Sign In
How to autoload helper functions in codeigniter 4
#1

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 
Code:
helper('url');

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


Messages In This Thread
How to autoload helper functions in codeigniter 4 - by geordy - 01-21-2017, 07:55 AM



Theme © iAndrew 2016 - Forum software by © MyBB