Created
January 16, 2012 15:12
-
-
Save smottt/1621293 to your computer and use it in GitHub Desktop.
Check if symfony2 form has errors in a twig template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% if form.get('errors') is not empty %} | |
Magic errors display! | |
{% endif %} |
I have been faffing around for a good half an hour trying to get this working, couldn't get the above examples working. The following works for me though.
{% if form.domain.vars.errors.count() > 0 %}
Do something
{% endif %}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank You!