Call to undefined function base_url() - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Call to undefined function base_url() (/showthread.php?tid=15606) |
Call to undefined function base_url() - El Forum - 02-10-2009 [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, Call to undefined function base_url() - El Forum - 02-10-2009 [eluser]SitesByJoe[/eluser] It is very important to set the base_url correctly in your config.php file. What is it set to? Call to undefined function base_url() - El Forum - 02-10-2009 [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. Call to undefined function base_url() - El Forum - 02-10-2009 [eluser]Anandafit[/eluser] I didn't config it. But my site worked fine Call to undefined function base_url() - El Forum - 02-10-2009 [eluser]Colin Williams[/eluser] You need to first load the URL helper http://ellislab.com/codeigniter/user-guide/helpers/url_helper.html Call to undefined function base_url() - El Forum - 02-10-2009 [eluser]Anandafit[/eluser] I configured it as "$config['base_url'] = "http://localhost/php/YesCoder/Codeiginator/";" but still my error is there. Call to undefined function base_url() - El Forum - 02-10-2009 [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');" Call to undefined function base_url() - El Forum - 02-10-2009 [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... Call to undefined function base_url() - El Forum - 02-10-2009 [eluser]Anandafit[/eluser] thanks for all and specially for Eric Willis. It is error because of missing "r". Now it work fine. Thanks . Call to undefined function base_url() - El Forum - 02-10-2009 [eluser]TheFuzzy0ne[/eluser] I just hate typoos. |