Fatal error: Call to undefined function site_url()
You have to load the helper. The function site_url()
is provided by the url
helper, as described here.
$this->load->helper('url');
You can try this:
First Load the URL Helper with:
$this->load->helper('url');
or set the following value inapplication/config/autoload.php
$autoload['helper'] = array('url');
- Then you can show the site url with:
base_url()
(result: http://example.com/) orsite_url()
(result: http://example.com/index.php/)
Note: Results depends on values stored in application/config/config.php