广告:宝塔Linux面板高效运维的服务器管理软件 点击【 https://www.bt.cn/p/uNLv1L 】立即购买
问题:
yii2.0 redirect 无法正常跳转 beforeAction。
首先看一下代码:
在正常情况下,使用 return $this->redirect($url);
(推荐教程:yii框架)
解决方式一:将变量名称改一下,可改为userid,则redirect可正常跳转。
解决方式二:在redirect后面使用send()
$this->redirect(登录页地址)->send(); $this->redirect(登录页地址);Yii::$app->response->send();登录后复制
解决方式三:
$this->redirect(登录页地址);Yii::$app->end();登录后复制
更多编程相关内容,请关注9543建站博客编程入门栏目!
以上就是yii中redirect无法正常跳转的详细内容,更多请关注9543建站博客其它相关文章!
发表评论