使用HMVC在codeigniter中扩展url_helper

时间:2015-08-10 15:00:33

标签: php codeigniter codeigniter-hmvc

我正在尝试扩展codeigniter中的url_helper,但我无法让它工作。任何帮助都会非常有用。

My_url_helper中的代码是

    <?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);
    }
}

我想像base_url()一样调用assets_url(),但是我收到以下错误

致命错误:在C中调用未定义的方法MX_Config :: assets_url().... 第9行的My_url_helper.php调用堆栈#TimeMemoryFunctionLocation 10.0005146600 {main}().. \ index.php:0 20.0014182912require_once(&#39; C:\ wamp \ system \ core \ CodeIgniter.php&#39;).. \ index.php:203 30.08072528912call_user_func_array:{C:\ wamp \ system \ core \ CodeIgniter.php:359}().. \ CodeIgniter.php:359 40.08072528976Dashboard-&gt; index().. \ CodeIgniter.php:359 50.08072529456Modules :: run().. \ dashboard.php:13

任何想法?

哦,在我的配置文件中,我有这段代码:

$config['assets_url']   = 'http://www.mywebsite.com/';

0 个答案:

没有答案