Call to undefined function base_url() |
[eluser]Anandafit[/eluser]
Hi, I am new for the this framework. I am fallowing a tutorial and now I have a error called "Call to undefined function base_url()" I used this function in my view as fallow, "<link href=”<?= base_url();?>css/default.css” rel=”stylesheet” type=”text/css” />" I configured autoload.php file for url helper as fallow, "$autoload['helpe'] = array('url','form','text','date','security');" But I didn't any change for "$config['base_url']= "http://your-site.com/";" in config.php. I think that this error appear as a result of "$config['base_url']" in config.php. But I don't know really is it. Help me to solve this. Regards, Ananda,
[eluser]SitesByJoe[/eluser]
It is very important to set the base_url correctly in your config.php file. What is it set to?
[eluser]Anandafit[/eluser]
Thanks for reply. I set it as "$config['base_url']= "http://your-site.com/";". But my application work fine without configuring this. But I use "<link href=”<?= base_url();?>css/default.css” rel=”stylesheet” type=”text/css” />" code segment I gave me that error.
[eluser]Colin Williams[/eluser]
You need to first load the URL helper http://ellislab.com/codeigniter/user-gui...elper.html
[eluser]Anandafit[/eluser]
I configured it as "$config['base_url'] = "http://localhost/php/YesCoder/Codeiginator/";" but still my error is there.
[eluser]Anandafit[/eluser]
where I want to put this "$this->load->helper('url');". I already configured my autoload.php as "$autoload['helpe'] = array('url','form','text','date','security');"
[eluser]Unknown[/eluser]
If this is a direct copy of your code... you need to change $autoload[‘helpe’] to $autoload[‘helper’] with an 'r' at the end...
[eluser]Anandafit[/eluser]
thanks for all and specially for Eric Willis. It is error because of missing "r". Now it work fine. Thanks .
|
Welcome Guest, Not a member yet? Register Sign In |