使用构造函数__construct,报错fetch()为空,没有人碰到么?

浏览:614 发布日期:2016/11/30 分类:求助交流 关键字: thinkphp5
//利用构造函数判断登录
public function __construct(){
//判断是否已经登录
if (!session('?squail') && !Cookie::has('squail')){
return header(strtolower("location: /admin/login"));
exit;
}
}

//后台首页
public function index(){

return $this->fetch('\index');
}

报错:
Call to a member function fetch() on null
最佳答案
评论( 相关
后面还有条评论,点击查看>>