4

I want to print all the validation errors together, and not each error next to each field.

But form_errors(form) isn't working.

I can print individual errors, so I thought I could just use form_errors(form.some_field) for each field. The problem is that it prints errors like 'This field cannot be blank', which is meaningless unless it is next to the field.

Any thoughts?

4
  • Then change the error message for the field... symfony.com/doc/2.0/book/…. Commented Sep 11, 2011 at 9:44
  • 2
    A framework shouldn't require that I do that -.- Commented Sep 11, 2011 at 14:17
  • Okay I guess I do not get the point... What difference does it make if you aggregate the errors when they still read "'This field cannot be blank'"?. Commented Sep 12, 2011 at 8:00
  • 1
    I mean that for base errors (ie: the ones related to the default validation options, like 'NotBlank'/'This field cant be blank'), I shouldn't have to rewrite all the messages, in each language. Commented Sep 12, 2011 at 17:02

1 Answer 1

4

You should look the error_bubbling field property. If you set that property true, any errors for this field will be passed to the parent field or form.

For example, if set to true on a normal field, any errors for that field will be attached to the main form, not to the specific field.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.