2013-04-27 104 views
1

不知道是什么问题?我的类,它是在应用程序/核心文件夹,那就是:Codeigniter 2.0无法扩展核心库

if (!defined('BASEPATH')) 
    exit('No direct script access allowed'); 

class MY_Image_lib extends CI_Image_lib { 

    public function __construct() { 
     parent::__construct(); 
    } 

    function tesit($msg) { 
     log_message('error', $msg); 
    } 

} 

我得到这个错误:

致命错误:调用未定义的方法CI_Image_lib ::调用testIt()

当我像这样调用它:$ this-> image_lib-> testit('not working');

我失踪了,这太奇怪了。

+1

为什么不使用*库*文件夹而不是核心? – 2013-04-27 23:55:54

+0

@CanGeliş嗨,我不是CI大师,我已经开始学习它了,为什么要使用它?当核心文件夹?有什么不同?我不知道他们是不同的。谢谢。 – user147 2013-04-28 00:20:43

+1

你不应该玩* core *那么多。 *库*文件夹是为您的目的而存在的。 http://ellislab.com/codeigniter/user-guide/general/creating_libraries.html – 2013-04-28 14:35:47

回答

0

移动你的类应用程序/库文件夹,它会覆盖一个在当你调用它的系统文件夹。