問題:
yii2.0 redirect 無法正常跳轉(zhuǎn) beforeAction。
首先看一下代碼:
在正常情況下,使用 return $this->redirect($url);
(推薦教程:yii框架)
解決方式一:將變量名稱改一下,可改為userid,則redirect可正常跳轉(zhuǎn)。
解決方式二:在redirect后面使用send()
$this->redirect(登錄頁地址)->send();? $this->redirect(登錄頁地址);Yii::$app->response->send();
解決方式三:
$this->redirect(登錄頁地址); Yii::$app->end();
更多編程相關(guān)內(nèi)容,請關(guān)注php中文網(wǎng)yii框架欄目!
? 版權(quán)聲明
文章版權(quán)歸作者所有,未經(jīng)允許請勿轉(zhuǎn)載。
THE END