title: yii2 redirect in controller action does not work?
body: <p>I am posting a form to /user/save in order to save user data. The problem occurs when i try to redirect the user if the $_SERVER['REQUEST_METHOD'] is NOT 'post'.</p>
  
  <p>My user controller code</p>
  
  <pre><code>namespace app\controllers;
  use Yii;
  use yii\web\Controller;
  use app\models\MyUser;
  
  class UserController extends Controller {
  
  public function actionSave() {
  
      if(!Yii::$app-&gt;request-&gt;getIsPost()) {
         $this-&gt;redirect('/user/index',302);
         exit(0);
     }
  
     //do something to save user submitted data       
  }
  
  }//~CLASS
  </code></pre>
  
  <p>The is no way to get the redirection to work. Although <code>!Yii::$app-&gt;request-&gt;getIsPost() is false</code> the call to <code>$this-&gt;redirect does nothing!</code></p>
  
  <p>Any help appreciated.</p>