Skip to content

Instantly share code, notes, and snippets.

@kbond
Created November 13, 2014 12:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kbond/e5c1be69ac39edef7d2c to your computer and use it in GitHub Desktop.
Save kbond/e5c1be69ac39edef7d2c to your computer and use it in GitHub Desktop.
translate symfony button labels
{% block button_widget -%}
{% if label is empty -%}
{% set label = name|humanize %}
{%- endif -%}
<button type="{{ type|default('button') }}" {{ block('button_attributes') }}>{{ label|trans({}, translation_domain)|raw }}</button>
{%- endblock button_widget %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment