我正在使用codeigniter 2.2.1
. 而现在codeigniter 3
发布了。我刚试了一下,结果出错了。
当我尝试加载方法时codeigniter2.x
,它显示
Unable to locate the model you have specified: Demo
Demo
我的方法文件在哪里。
控制器 -welcome.php
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Welcome extends CI_Controller {
public function __construct() {
parent::__construct();
$this->load->model('demo');
}
public function index() {
$data = $this -> demo ->check();
print_r($data);
}
}
模型 - demo.php
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Demo extends CI_Model {
public function __construct() {
$this->load->database();
}
}
我无法弄清楚这段代码有什么问题。请帮忙。先感谢您..
编辑:-这在我的 wamp 机器上运行良好。但我现在在我的研究所托管网站的另一台本地机器上检查它。那里不工作