Here's my saveAction
code (where the form passes the data to)
public function saveAction()
{
$user = OBUser();
$form = $this->createForm(new OBUserType(), $user);
if ($this->request->getMethod() == 'POST')
{
$form->bindRequest($this->request);
if ($form->isValid())
return $this->redirect($this->generateUrl('success_page'));
else
return $this->redirect($this->generateUrl('registration_form'));
} else
return new Response();
}
My question is: how do I get the errors if $form->isValid()
returns false
?
For my flash messages I was happy with
$form->getErrorsAsString()
Edit (from Benji_X80): For SF3 use
$form->getErrors(true, false);