Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7177237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:40:12+00:00 2026-05-28T16:40:12+00:00

I use embedded controller to render form that’s used on multiple pages: Twig {%

  • 0

I use embedded controller to render form that’s used on multiple pages:

Twig

{% render 'Bundle:Controller:someForm' %}

Controller

public function someFormAction()
{
    // Some logic

    ...

    if ($form->isValid()) {

        ...

        $this->get('session')->setFlash('successful', "Woey!");

        return $this->redirect($this->generateUrl('homepage'));
    }

    return $this->render('Bundle:Template:form.html.twig', array('form' => $form->createView()));
}

I need to redirect back to homepage after the form was successfully submitted as a part of post-redirect-get design pattern. If I use it as I described above, I’ll get exception as response from embedded controller was 302 instead of 200 (at least I expect it works like this).

Is it possible to redirect normally in such scenario? Or am I approaching the situation (with form that’s rendered on multiple pages) from totally wrong angle?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T16:40:13+00:00Added an answer on May 28, 2026 at 4:40 pm

    Just to make it official answer, Fabien doesn’t think Symfony2 will ever support this feature.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form I need to use on multiple pages: Controller $emailForm =
I make a distributed embedded application that will make use of several micro-controllers. The
So I have an embedded Linux device that is connected to a motor controller
Currently we have a lot of web pages that either have SQL statements embedded
What is the best way to use an embedded database, say sqlite in Python:
Could you, please, give a code snippet showing how to use Lua embedded in
I use both Firebird embedded and Firebird Server, and from time to time I
On an embedded target I use far pointers to access some parts of the
Is it possible to use a flash document embedded in HTML as a link?
At the moment we use HSQLDB as an embedded database, but we search for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.