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

<?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->是用來取得目前物件的非靜態屬性用的例如:

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()

越努力,越幸运

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

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

熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!