I have a Customer entity that only has a unique Email field to it. I am trying to edit a customer\'s email and the validation works fine. However I have this in my controller:>
In Symfony 2.3, you can use this one :
if ($form->isValid()){
# Code...
} else {
foreach ($form->getIterator() as $key => $child) {
if ($child instanceof Form) {
foreach ($child->getErrors() as $error) {
$errors[$key] = $error->getMessage();
}
}
}
}
This will get you an array ($errors
) with the errors from the children.