mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-02 04:37:42 +08:00
add a comment to explain why Url::to() is called in Controller::redirect()
close #16887
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user