从嵌入式控制器重定向

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?

Maybe this will help you. I use this to show 404 pages if a resource was not found in an embedded controller.

try
{
    return $this->render('MyBundle:Table:list.html.twig', $data);
}
catch(\Twig_Error_Runtime $e)
{
    if($e->getPrevious() instanceof NotFoundHttpException)
    {
        throw $this->createNotFoundException();
    }
    else throw $e;
}

You could make a RedirectHttpException, which would hold your redirection data, and throw it in your embedded controller. Then redirect in your parent controller.