templates/includes/form/checkbox.html.twig line 1

Open in your IDE?
  1. {% extends "includes/form/form-control.html.twig" %}
  2. {% set checked = checked | default(false) %}
  3. {% set style = style | default('default') %}
  4. {% set type  = type  | default('checkbox') %}
  5. {% set styleClasses = {
  6.     'default': '',
  7.     'switch': 'form-switch'
  8. } %}
  9. {% set className = className|default('') ~ ' form-check ' ~ attribute(styleClasses, style) %}
  10. {% block input %}
  11.     <input class="form-check-input {{ attribute(classNames, 'input') }} {{ (errors | length > 0 )? 'is-invalid': '' }}"
  12.     {{ checked ? 'checked': '' }}
  13.     {% for key, value in inputAttributes %}
  14.         {{ key }}="{{ value }}"
  15.     {% endfor %} >
  16. {% endblock %}
  17. {% block label %}
  18.     {{ include('includes/form/form-elements/form-control-label.html.twig', _context | merge({
  19.         className : 'form-check-label' ~ classNames.label
  20.     }), with_context = false) }}
  21. {% endblock %}