I am trying to extend the url_helper in codeigniter but i just cant get it to work. Any help would be very much appretiated.
my code in My_url_helper is
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
if ( ! function_exists('assets_url'))
{
function assets_url($uri = '')
{
$CI =& get_instance();
return $CI->config->base_url($uri);
}
}
I want to call assets_url() just like base_url(), but i get the following error
Fatal error: Call to undefined method MX_Config::assets_url() in C.... My_url_helper.php on line 9 Call Stack #TimeMemoryFunctionLocation 10.0005146600{main}( )..\index.php:0 20.0014182912require_once( 'C:\wamp\system\core\CodeIgniter.php' )..\index.php:203 30.08072528912call_user_func_array:{C:\wamp\system\core\CodeIgniter.php:359} ( )..\CodeIgniter.php:359 40.08072528976Dashboard->index( )..\CodeIgniter.php:359 50.08072529456Modules::run( )..\dashboard.php:13
any ideas?
oh and in my config file i have this code:
$config['assets_url'] = 'http://www.mywebsite.com/';