RedirectController::redirectAction()

Response redirectAction(Request $request, string $route, bool $permanent = false, bool|array $ignoreAttributes = false)

Redirects to another route with the given name.

The response status code is 302 if the permanent parameter is false (default), and 301 if the redirection is permanent.

In case the route name is empty, the status code will be 404 when permanent is false and 410 otherwise.

Parameters

Request $request The request instance
string $route The route name to redirect to
bool $permanent Whether the redirection is permanent
bool|array $ignoreAttributes Whether to ignore attributes or an array of attributes to ignore

Return Value

Response A Response instance

Exceptions

HttpException In case the route name is empty
doc_Symfony
2016-10-28 06:28:40
Comments
Leave a Comment

Please login to continue.