In this post we will give you information about [Solved]Fatal error: Call to undefined function base_url() in Codeigniter. Hear we will give you detail about [Solved]Fatal error: undefined function base_url() in Codeigniter And how to use it also give you demo for it if it is necessary.
[Solved]Fatal error: Call to undefined function base_url() in Codeigniter
In this post, I will let you know how to fix the issue “Call to undefined function base_url()” in Codeigniter.
When i was started with Codeigniter then i had faced some fatal error like this :
Call to undefined function base_url() in C:wampwwwDemo-CIapplicationviews\productslist.php on line 5
I was getting an error because I did not load the url helper to access that function.
I put url in autoload file and you will find the autoload.php in following path application/config/autoload.php.
$autoload['helper'] = array('url');
Save your autoload.php file and run your application, base_url() function will work now.
Alternately, you can add following line of code somewhere in controller :
Hope, Above solution will resolve your issue whenever you will get kind of error.
Hope this code and post will helped you for implement [Solved]Fatal error: undefined function base_url() in Codeigniter. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs