summaryrefslogtreecommitdiff
path: root/resources/views/macros/form.twig
blob: 5d41b085d11673d6d693c91f2813a52805576c87 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{% macro input(name, label, type, required) %}
    <div class="form-group">
        {% if label %}
            <label for="{{ name }}">{{ label }}</label>
        {% endif %}
        <input type="{{ type|default('text') }}" class="form-control" id="{{ name }}" name="{{ name }}"
                {%- if required|default(false) %} required="required"{% endif -%}
        >
    </div>
{% endmacro %}

{% macro hidden(name, value) %}
    <input type="hidden" id="{{ name }}" name="{{ name }}" value="{{ value }}">
{% endmacro %}

{% macro submit(label) %}
    <button type="submit" class="btn btn-default">{{ label|default(__('form.submit')) }}</button>
{% endmacro %}