Welcome Guest, Not a member yet? Register   Sign In
Help please!
#1

[eluser]Unknown[/eluser]
Hi everybody, and Merry Christmas !

I wish someone could help me please, i have a weird problem : i write <?php $this->config->item('base_url'); ?> in my view, and nothing is displayed, as you can see on this page : http://test.ownsurf.com/.

Yesterday i was having the same problem, the same view, from the same controller, but not the same function.

<?php

function index()
{

$this->load->view('header');

}
function ref()
{

$this->load->view('header');

}

From the function index, the base_url variable was correct, but from the ref function, no ...

If someone have had the same problem previously, and fixed it, please help me, thanks!!
#2

[eluser]Unknown[/eluser]
Hi ownAks and Merry Christmas,

You are doing a small mistake which I do all the time Smile

Code:
<?php $this->config->item(‘base_url’); ?>

You forgot to use echo

Code:
<?php echo $this->config->item(‘base_url’); ?>

Hope this helps Wink
#3

[eluser]InsiteFX[/eluser]
Load the url_helper

Code:
<?php echo base_url(); ?>

//EXAMPLE:
<base href="<?php echo base_url(); ?>">

InsiteFX
#4

[eluser]Unknown[/eluser]
OMG Yes it works !!! thank you very much, of course if i forgot the "echo" ...




Theme © iAndrew 2016 - Forum software by © MyBB