<?php
namespace app\index\controller;
use app\index\controller\Base;
class Index extends Base
{
public function index()
{
$this->isLogin(); //判断用户是否登录
return $this->view->fetch();
}
}
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
$this->isLogin();
isLogin()这个方法不在你的类里面;你要在类里面新增一个isLogin();$this->是用来获取当前对象的非静态属性用的例如:
那就肯定是这个方法有问题了,isLogin()
加了下面这一句,页面就出错了
$this->isLogin(); //判断用户是否登录