Created
May 9, 2012 11:00
-
-
Save itavero/2643731 to your computer and use it in GitHub Desktop.
Workaround for the "Unable to choose translation" problem when using the Form component, Validation component, Translation component and Twig. (keywords: Symfony, Silex)
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
{% extends 'Form/form_div_layout.html.twig' %} | |
{# | |
Extends from Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig | |
Overrides the form_errors block so it no longer uses transchoice (which | |
was causing a problem). | |
#} | |
{% block form_errors %} | |
{% spaceless %} | |
{% if errors|length > 0 %} | |
<ul> | |
{% for error in errors %} | |
<li>{{ | |
error.messageTemplate|trans(error.messageParameters, 'validators') | |
}}</li> | |
{% endfor %} | |
</ul> | |
{% endif %} | |
{% endspaceless %} | |
{% endblock form_errors %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment