grav-theme-libretic/templates/forms/form.html.twig
2015-01-15 19:15:54 +01:00

18 lines
589 B
Twig

<div class="alert">{{ form.message }}</div>
<form name="{{ form.name }}"
action="{{ uri.rootUrl ~ (form.action|default(page.route)) }}"
method="{{ form.method|upper|default('POST') }}">
{% for field in form.fields %}
{% set value = form.value(field.name) %}
<div>
{% include "forms/fields/#{field.type}/#{field.type}.html.twig" %}
</div>
{% endfor %}
<div class="buttons">
{% for button in form.buttons %}
<button class="button" type="{{ button.type|default('submit') }}">{{ button.value|default('Submit') }}</button>
{% endfor %}
</div>
</form>