Heim > Fragen und Antworten > Hauptteil
<?php
namespace appindexcontroller;
use appindexcontrollerBase;
class Index erweitert Base
{
public function index()
{
$this->isLogin(); // Bestimmen, ob der Benutzer angemeldet ist
return $ this-> ;view->fetch();
}
}
糊涂斌2017-08-30 11:25:53
$this->isLogin();
isLogin()这个方法不在你的类里面;你要在类里面新增一个isLogin();$this->是用来获取当前对象的非静态属性用的例如:
class Index extends Base { public function index() { $this->isLogin(); //判断用户是否登录 return $this->view->fetch(); } public isLogin(){ #code 判断用户是否登录 } }