2015-06-11 55 views
0

我已经创建了一个扩展是CI_Controller内部应用程序/核心文件夹MY_Controller.php并创建了在Codeigniter版本3.0.0错误?

我创建的扩展MY_Controller这个完美的作品,但是当user.php的控制器在同一文件夹扩展MY_Controller一个Public_Controller.php改变我的用户控制器扩展Public_Controller我得到这个错误

Severity: Error 

Message: Class 'Public_Controller' not found 

这是一个错误?

是在有笨版本的任何其他众所周知的缺陷3.0.0

+0

是否包含定义此public_controller文件? –

回答

0

我解决了这个问题先生: 我加入这段代码块在我的application/config/config.php文件

function __autoload($classname){ 
     if(strpos($classname, 'CI_')!==0){ 
    $file = APPPATH.'core/'.$classname.'.php'; 
    if(file_exists($file)&& is_file($file)){ 
     @include_once($file); 
    } 
} 

}

1

不,这不是一个错误......它不会奇迹般地包括您Public_Controller.php只是因为你把它放在那里。您必须手动包含该文件,最好从MY_Controller.php

+0

我怎么能包括它先生? –