Skip to content

Instantly share code, notes, and snippets.

@rskuipers
Created January 12, 2015 10:34
Show Gist options
  • Select an option

  • Save rskuipers/8bc277ac0c7b30accda6 to your computer and use it in GitHub Desktop.

Select an option

Save rskuipers/8bc277ac0c7b30accda6 to your computer and use it in GitHub Desktop.
{% macro form_row_shared(field, class) %}
<div class="{{ class }}{% if field.vars.errors|length %} has-error{% endif %}">
{{ form_widget(field) }}
{% for error in field.vars.errors %}
<span class="help-block form-error">
{{
error.messagePluralization is null
? error.messageTemplate|trans(error.messageParameters, 'validators')
: error.messageTemplate|transchoice(error.messagePluralization, error.messageParameters, 'validators')
}}
</span>
{% endfor %}
</div>
{% endmacro %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment