add a comment to explain why Url::to() is called in Controller::redirect()

close #16887
This commit is contained in:
Carsten Brandt
2018-11-14 15:56:03 +01:00
parent 82adaefc89
commit c82aedb86d

View File

@ -200,6 +200,7 @@ class Controller extends \yii\base\Controller
*/
public function redirect($url, $statusCode = 302)
{
// calling Url::to() here because Response::redirect() modifies route before calling Url::to()
return Yii::$app->getResponse()->redirect(Url::to($url), $statusCode);
}