CodeIgniter Forums
base_url() doesn't show, weird @[email protected] - 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: base_url() doesn't show, weird @[email protected] (/showthread.php?tid=55291)



base_url() doesn't show, weird @[email protected] - El Forum - 10-18-2012

[eluser]solid9[/eluser]
I installed a new CodeIgniter into my site.

I already configured the config.php
Code:
$config['base_url'] = 'http://sample.com/adminpro/';

And below is my controller
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Front extends MY_Controller
{

    function __construct ()
    {
        parent::__construct();

    }

public function index()
{
        echo 'Front controller';
  
    //$this->load->view('welcome_message', $this->data);
    $this->load->view('template/master');
}

public function hello()
{  
  echo '<br>Hello World!<br>';
  echo base_url();
}
}


But when I call http://sample.com/adminpro/front/hello/

It doesn't display the base_url(), any help.

weird.







base_url() doesn't show, weird @[email protected] - El Forum - 10-18-2012

[eluser]Aken[/eluser]
Did you load the URL helper? Do you have error displaying turned off?


base_url() doesn't show, weird @[email protected] - El Forum - 10-19-2012

[eluser]josepichu[/eluser]
you have to include the URL helper in the autoload config file


base_url() doesn't show, weird @[email protected] - El Forum - 10-19-2012

[eluser]solid9[/eluser]
Yeah I think I forgot to include the URL helper.
Thanks for reminding me guys.
I will try.