Hi, there I met the same problem , i googles lots of resource, found that there is someone who hack the Form component.
you can find it here: https://gist.github.com/968857 But i really hope that someone who can add an function which can return all errors message which defined in validtion.yml, or next beta version, someone can add the getAllErrors method inside Form components to return all children's error message. On Jun 6, 6:59 pm, renegare <m...@renegare.com> wrote: > I am very new to this so hoping there is a simple solution. Using the > Form Classes as advised in the symfony2 documentation, I need a way > for $form->getErrors() to return ALL errors. > > I find it confusing that the $form->isValid() checks all children > elements, but when you call $form->getErrors() it returns nothing. > > Could there be a function somewhere called getAllErrors()? That would > return > a nested tree of errors? > > For the mean time I just created my own utility class to traverse > through the children of a given form and extract all the errors. > > Unless there is something missing, I think we need to either change > the function $form->getErrors() or make the following function: > FormBuilder::getForm() initiate a form object based of a predefined > parameter e.g. form.builder.getform.class > > Context: The reason why i need this is because I would like to send > back the errors as an ajax array. > > Thanks in advance > > M. -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en