I got an answer on the official GitHub, and I tried it, and it really solved the problem.
Description of the previous problem:
- Before is the 2.0.3, then uses the composer to upgrade directly to 2.0.8, is not normal, thought is my code question, then tries again
- With composer Download yii-advance-2.0.8, in beforeaction jump or not, so on the forum asked
In the ordinary action there is no problem, but put in the beforeaction is not jump, equivalent to return is true, skip directly.
Do not jump code:
return $this->redirect(‘http://www.yiichina.com/‘);
Jump code:
return $this->redirect(‘http://www.yiichina.com/‘)->send();
That is, after redirect () add a Send () method on the line, I saw the YII2 code update, redirect belongs to the response class did not change too much, it should be the controller's operating mechanism in the beforeaction has changed the result.
REDIRECT Invalid in beforeaction, Yii2.0.8