redirect() public method
Redirects the browser to the specified URL. This method adds a "Location" header to the current response. Note that it does not send out the header until send() is called. In a controller action you may use this method as follows: return Yii::$app->getResponse()->redirect($url);
In other places, if you want to send out the "Location" header immediately, you should use the following code: Yii::$app->getResponse()->redirect($url)->send();
return;
In A