summaryrefslogtreecommitdiff
path: root/resources/views/macros
diff options
context:
space:
mode:
Diffstat (limited to 'resources/views/macros')
-rw-r--r--resources/views/macros/form.twig18
1 files changed, 18 insertions, 0 deletions
diff --git a/resources/views/macros/form.twig b/resources/views/macros/form.twig
new file mode 100644
index 00000000..5d41b085
--- /dev/null
+++ b/resources/views/macros/form.twig
@@ -0,0 +1,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 %}