* Base URL
* Returns the "base_url" item from your config file
* @access public
* @return string
if ( ! function_exists('base_url'))
$CI =& get_instance();
That’s the function I got from 2.0.3 core. There aren’t any input parameters.
The documentation, (codeigniter dot com/user_guide/helpers/url_helper.html) says,
Returns your site base URL, as specified in your config file. Example:
This function returns the same thing as site_url, without the index_page or url_suffix being appended.
Also like site_url, you can supply segments as a string or an array. Here is a string example:
The above example would return something like: http://example.com/blog/post/123
This is useful because unlike site_url(), you can supply a string to a file, such as an image or stylesheet. For example:
This would give you something like: http://example.com/images/icons/edit.png
My reason for wanting to use this function was because site_url wasn’t smart enough to realize that when I fed it the link to an image, it shouldn’t append the .html suffix that I have stuck in the url_suffix section of the config.