84669 人学习
152542 人学习
20005 人学习
5487 人学习
7821 人学习
359900 人学习
3350 人学习
180660 人学习
48569 人学习
18603 人学习
40936 人学习
1549 人学习
1183 人学习
32909 人学习
<?phpnamespace app\index\controller;use app\index\controller\Base;class Index extends Base{ public function index() { $this->isLogin(); //判断用户是否登录 return $this->view->fetch(); }}
嗯哼
$this->isLogin();
isLogin()这个方法不在你的类里面;你要在类里面新增一个isLogin();$this->是用来获取当前对象的非静态属性用的例如:
class Index extends Base { public function index() { $this->isLogin(); //判断用户是否登录 return $this->view->fetch(); } public isLogin(){ #code 判断用户是否登录 } }
那就肯定是这个方法有问题了,isLogin()
加了下面这一句,页面就出错了
$this->isLogin(); //判断用户是否登录
$this->isLogin();
isLogin()这个方法不在你的类里面;你要在类里面新增一个isLogin();$this->是用来获取当前对象的非静态属性用的例如:
那就肯定是这个方法有问题了,isLogin()
加了下面这一句,页面就出错了
$this->isLogin(); //判断用户是否登录