To use base_url() , you must first load the url. This can be done either in application/config/autoload.php (on line or around line 67):
$autoload['helper'] = array('url');
Or, manually:
$this->load->helper('url');
After downloading it, be sure to remember that base_url() does not imply printing or echoing, but returns the value that will be printed:
echo base_url();
Remember also that the return value is the URL of the site database as specified in the configuration file. CodeIgniter will also contain an empty value in the configuration file:
If this (base_url) is not installed, CodeIgniter will guess the protocol, domain and path to your installation.
application / config / config.php line 13
Sampson Jun 23 '11 at 4:40 2011-06-23 04:40
source share