Skip to content

Commit

Permalink
Add blocks so classes can be overridden more easily in themes
Browse files Browse the repository at this point in the history
  • Loading branch information
flaviocopes committed Feb 14, 2016
1 parent 2e6ba62 commit 519b187
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion templates/forms/default/form.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
<form name="{{ form.name }}"
action="{{ action }}"
method="{{ method }}"{{ multipart }}
{% block form_classes %}
{% if form.classes %}class="{{ form.classes }}"{% endif %}
{% endblock %}
>

{% for field in form.fields %}
Expand All @@ -28,7 +30,14 @@

<div class="buttons">
{% for button in form.buttons %}
<button class="{{ button.classes|default('button') }}" type="{{ button.type|default('submit') }}">{{ button.value|t|default('Submit') }}</button>
<button
{% block button_classes %}
class="{{ button.classes|default('button') }}"
{% endblock %}
type="{{ button.type|default('submit') }}"
>
{{ button.value|t|default('Submit') }}
</button>
{% endfor %}
</div>

Expand Down

0 comments on commit 519b187

Please sign in to comment.