Skip to content
\n

This ensures the flow step is created $v->getStepForm(), and the status code is 303 until the flow is finished.

\n

Your form flow controller would then look like this:

\n
class AnyFormFlowController extends AbstractController\n{\n    use TurboFlowTrait; // <-- add trait\n\n    #[Route('/form-flow')]\n    public function __invoke(Request $request): Response\n    {\n        // ...\n\n        return $this->render('any_flow.html.twig', [\n            'form' => $flow, // <-- without calling getStepForm()\n        ]);\n    }\n}
","upvoteCount":1,"url":"https://github.com/symfony/symfony/discussions/62666#discussioncomment-15174596"}}}
Discussion options

You must be logged in to vote

After a stateful request from a form submission, Turbo Drive expects the server to return an HTTP 303 redirect response, which it will then follow and use to navigate and update the page without reloading.

https://turbo.hotwired.dev/handbook/drive#redirecting-after-a-form-submission

So, to make Turbo handle the transition correctly, return a 303 status code for the next success step, or apply this trait in every controller that implements form flows:

trait TurboFlowTrait
{
    public function render(string $view, array $parameters = [], ?Response $response = null): Response
    {
        $response ??= new Response();

        foreach ($parameters as $k =>$flow) {
            if (!$flow i…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by yceruto
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants
Converted from issue

This discussion was converted from issue #62659 on December 05, 2025 16:29.