亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

判斷是否登入時頁面出錯,怎麼解決?
星河4p
星河4p 2017-08-16 09:08:58
0
4
1485

<?php
namespace app\index\controller;
use app\index\controller\Base;
class Index extends Base
{
? ?public function index()
? ?{
? ? ? ?$this->isLogin(); ? //判斷使用者是否登入
? ? ? ?return $this->view->fetch();
? ?return $this->view->fetch();
? ?return##}#

星河4p
星河4p

嗯哼

全部回覆(3)
糊涂斌

$this->isLogin();

isLogin()這個方法不在你的類別裡面;你要在類別裡面新增一個isLogin();$this->是用來取得目前物件的非靜態(tài)屬性用的例如:

class?Index?extends?Base
{
???public?function?index()
???{
???????$this->isLogin();???//判斷用戶是否登錄
???????return?$this->view->fetch();
???}
???public?isLogin(){
???????#code?判斷用戶是否登錄
???}
}


  • 回覆 回答不對
    鳶尾花 作者 2018-01-03 18:57:03
ringa_lee

那就一定是這個方法有問題了,isLogin()

越努力,越幸運(yùn)

加了下面這一句,頁面就出錯了

$this->isLogin(); ? //判斷使用者是否登入

最新下載
更多>
網(wǎng)站特效
網(wǎng)站源碼
網(wǎng)站素材
前端模板