-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathform_fieldset.html.twig
34 lines (26 loc) · 1.2 KB
/
form_fieldset.html.twig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{#
This file is part of the AMP Twig theme.
(c) Beñat Espiña <benatespina@gmail.com>
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
#}
{##
A component that displays the form fieldset.
@param form_fieldset_class string
@param form_fieldset_disabled boolean=false
@param form_fieldset_form string
@param form_fieldset_legend string
@param form_fieldset_name string
#}
{% set content %}
{%- block form_fieldset_content -%}{%- endblock form_fieldset_content -%}
{% endset %}
{% set form_fieldset_disabled = form_fieldset_disabled|default(false) %}
{% set class = form_fieldset_class|default ? 'class=form-fieldset ' ~ form_fieldset_class : 'class=form-fieldset' %}
{% set disabled = form_fieldset_disabled ? 'disabled' %}
{% set form = form_fieldset_form|default ? 'form=' ~ form_fieldset_form %}
{% set name = form_fieldset_name|default ? 'name=' ~ form_fieldset_name %}
<fieldset {{ class }} {{ disabled }} {{ form }} {{ name }}>
{% if form_fieldset_legend|default %}<legend>{{ form_fieldset_legend }}</legend>{% endif %}
{{- content -}}
</fieldset>