Symfony2 form: how to display all errors?

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

But form_errors (form) does not work.

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 such as โ€œThis field cannot be empty,โ€ which is pointless if it is not next to the field.

Any thoughts?

+4
source share
1 answer

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

For example, if the normal field is set to true, any errors for this field will be bound to the main form, and not to a specific field.

+4
source

All Articles