_initialize Fatal error: Call to a member func..

浏览:548 发布日期:2014/05/24 分类:求助交流 关键字: _initialize Model报错
MODEL的_initialize里用$this->where报错!
我在ThinkPHP 3.1.3 里的自定义Model类中用 $this->where
结果报错:Fatal error: Call to a member function select()我定义了一个/Lib/Model/DiquModel.class.php(表名称diqu),方法Class DiquModel extends Model{

public function _initialize(){
$this->cache = $this->select();
}

public function getSub(){
return $this->cache;
}
}
然后在/Lib/Action/Home/IndexAction.class.php 的index方法中使用了
D('Diqu')->getSub()结果报错!class IndexAction extends Action{
public function index(){
$arr = D('Diqu')->getSub();
}
}
最佳答案
评论( 相关
后面还有条评论,点击查看>>