redirect() public method
Redirects the browser to the specified URL.
This method is a shortcut to yii\web\Response::redirect().
You can use it in an action by returning the yii\web\Response directly:
// stop executing this action and redirect to login page return $this->redirect(['login']);
public yii\web\Response redirect ( $url, $statusCode = 302 ) | ||
---|---|---|
$url | string|array |
The URL to be redirected to. This can be in one of the following formats:
Any relative URL will be converted into an absolute one by prepending it with the host info of the current request. |
$statusCode | integer |
The HTTP status code. Defaults to 302. See http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html for details about HTTP status code |
return | yii\web\Response |
The current response object |
Please login to continue.