Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Controller] Convenience method redirectToCurrentRoute() #44485

Copy link
Copy link
Closed
@ThomasLandauer

Description

@ThomasLandauer
Issue body actions

Description

What's the best practice for redirecting to the current route (e.g. when following the Post/Redirect/Get pattern)? I'm using

return $this->redirectToRoute($request->get('_route'));

...but since #42392, Request::get() is marked @internal.

So what about a new convenience method AbstractController::redirectToCurrentRoute(int $status = 302/303)?

Or am I missing something and there is another (better) way already? => Then it should be mentioned in https://symfony.com/index.php/doc/current/controller.html#redirecting

Example

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.