Welcome Guest, Not a member yet? Register   Sign In
base_url() doesn't show, weird @__@
#1

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




#2

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

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

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




Theme © iAndrew 2016 - Forum software by © MyBB