Skip to content

Instantly share code, notes, and snippets.

@itavero
Created May 9, 2012 11:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save itavero/2643731 to your computer and use it in GitHub Desktop.
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)
{% 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