Php 在第一个codeigniter应用程序上获取错误
我是codeigniter的新手,我正在尝试我的第一个应用程序 但我得到了以下错误:Php 在第一个codeigniter应用程序上获取错误,php,codeigniter,controller,Php,Codeigniter,Controller,我是codeigniter的新手,我正在尝试我的第一个应用程序 但我得到了以下错误: Fatal error: Class 'Controller' not found in /var/www/CodeIgniter/application/controllers/helloworld.php on line 2 应该这样做 Class Mycontroller Extends CI_Controller { function __construct(){ parent
Fatal error: Class 'Controller' not found in /var/www/CodeIgniter/application/controllers/helloworld.php on line 2
应该这样做
Class Mycontroller Extends CI_Controller
{
function __construct(){
parent::__construct();
}
//other functions
}
Class Mymodel Extends CI_Model
{
function __construct(){
parent::__construct();
}
//other functions
}
我认为您可能正在使用codeigniter 2,所以请使用CI_控制器而不是控制器。现在,在第2行的/var/www/codeigniter/application/models/helloworld_Model.php中,它在替换CI_u控制器后抛出此错误。在中未找到致命错误:类“Model”/第2行的var/www/CodeIgniter/application/models/helloworld_model.php使用CI_model非model
class Mycontroller扩展CI_控制器
notclass Mycontroller扩展CI_控制器