Skip to content

Instantly share code, notes, and snippets.

@Axxiss
Created March 28, 2012 09:16
Show Gist options
  • Save Axxiss/2224984 to your computer and use it in GitHub Desktop.
Save Axxiss/2224984 to your computer and use it in GitHub Desktop.
Several unrelated forms in the same page.
public function acmeAction()
{
$acme = new Acme();
$form = $this->get('form.factory')
->createNamedBuilder(new AcmeType(), 'acme_form', $acme)
->getForm();
$request = $this->getRequest();
if ($request->getMethod() == 'POST' && $request->request->has('acme_form')) {
$form->bindRequest($request);
if($form->isValid())
{
//do something
}
}
//return something
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment