I have indexAction and contactAction
contactAction is a simple fieldless form (FormType), as shown below:
public function contactAction(Request $request)
{
$form = $this->createForm(new ContactType());
$form->handleRequest($request);
if ($form->isValid()) {
$firstName = $form->get('first_name')->getData();
$lastName = $form->get('last_name')->getData();
$email = $form->get('email')->getData();
$message = $form->get('message')->getData();
}
return array(
'form' => $form->createView()
);
}
and I create this form in my indexAction using this TWIG command:
{{ render(controller('RusselBundle:Default:contact')) }}
Everything is okey, if the page is not reloaded, the HTML validators work fine, but if the form has some errors, such as: firstName length, the error does not appear at all, how can I do this so that the errors appear as indexAction? Any help would be greatly appreciated. I'm just wondering, and if ... how? Sorry for my English....
source
share