Home > PHP Framework > YII > Redirect in yii cannot jump normally

Redirect in yii cannot jump normally

王林
Release: 2020-02-20 15:15:45
Original
3006 people have browsed it

Redirect in yii cannot jump normally

Problem:

yii2.0 redirect cannot jump to beforeAction normally.

First look at the code:

Redirect in yii cannot jump normally

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();
Copy after login

Solution 3:

$this->redirect(登录页地址);
Yii::$app->end();
Copy after login

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!

Related labels:
yii
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template