Home  >  Article  >  Backend Development  >  codeigniter 如何载入model类

codeigniter 如何载入model类

WBOY
WBOYOriginal
2016-06-13 13:50:121194browse

codeigniter 怎么载入model类?
我必须这么写
class Indexwelcome extends Controller {
function __construct()
{
parent::Controller();
$this->load->model('Mtest','',TRUE);

}
但是我看到别人这么写
$this->load->model('Mtest');

如果我后面不加,'',TURE,就会报错,请问为什么啊


------解决方案--------------------
不会吧?一直都是这么用的!没有什么错误啊!
你的Model是怎么声明的不?
class newModel extends Model {
function newModel(){
parent::Model();
}
}

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn