Welcome Guest, Not a member yet? Register   Sign In
Call to undefined function base_url()
#1

[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,
#2

[eluser]SitesByJoe[/eluser]
It is very important to set the base_url correctly in your config.php file.

What is it set to?
#3

[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.
#4

[eluser]Anandafit[/eluser]
I didn't config it. But my site worked fine
#5

[eluser]Colin Williams[/eluser]
You need to first load the URL helper

http://ellislab.com/codeigniter/user-gui...elper.html
#6

[eluser]Anandafit[/eluser]
I configured it as "$config['base_url'] = "http://localhost/php/YesCoder/Codeiginator/";" but still my error is there.
#7

[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');"
#8

[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...
#9

[eluser]Anandafit[/eluser]
thanks for all and specially for Eric Willis. It is error because of missing "r". Now it work fine.
Thanks .
#10

[eluser]TheFuzzy0ne[/eluser]
I just hate typoos. Tongue




Theme © iAndrew 2016 - Forum software by © MyBB