In Twig template I check if a field has an error like this:
{% if form.points.get('errors') is not empty %}
Is there any method like:
{% if form.points.hasErrors() %}
to do it simpler? It's not a big difference, but if I can't do it easier why not.
better way I found, is to use this kind of code
{% if not form.vars.valid %} <div class="alert alert-error"> {{ form_errors(form) }} </div> {% endif %}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With