I want to create a webservice to which I submit a form, and in case of errors, returns a JSON encoded list that tells me which field is wrong.
currently I only get a
This does the trick for me
$errors = []; foreach ($form->getErrors(true, true) as $formError) { $errors[] = $formError->getMessage(); }