Home > Article > PHP Framework > Redirect in yii cannot jump normally
Problem:
yii2.0 redirect cannot jump to beforeAction normally.
First look at the code:
Under normal circumstances, use return $this->redirect($url);
(Recommended tutorial: yii framework)
Solution 1: Change the variable name to userid, then redirect can jump normally.
Solution 2: Use send() after redirect
$this->redirect(登录页地址)->send(); $this->redirect(登录页地址);Yii::$app->response->send();
Solution 3:
$this->redirect(登录页地址); Yii::$app->end();
For more programming related content, please pay attention to php Chinese website Programming Introductory column!
The above is the detailed content of Redirect in yii cannot jump normally. For more information, please follow other related articles on the PHP Chinese website!