In config.php
$config[\'base_url\'] = \'http://localhost/codeigniter/\';
In View
You need to load the URL Helper in order to use base_url(). In your controller, do:
base_url()
$this->load->helper('url');
Then in your view you can do:
echo base_url();