{% spaceless %} {# Parameters: - "id" (string) (default: '') - "name" (string) (default: '') - "value" (string) (default: '') - "disabled" (boolean) (default: false) - "invalid" (boolean) (default: false) - "checked" (boolean) (default: false) - "helper_id" (string) (default: '') - "icon_path" (string) (default: '') - "extra_classes" (optional) (string) (default: '') - "extra_attributes" (optional) (array) (default: []) - "name" (string) Attribute name, eg. 'data-test' - "value" (string) Attribute value, eg: 'data-test-1' - "extra_input_attributes" (optional) (array) (default: []) - "name" (string) Attribute name, eg. 'data-test' - "value" (string) Attribute value, eg: 'data-test-1' Blocks: - "helper_text" - "label" #} {# Internal properties #} {% set _id = id|default('') %} {% set _name = name|default('') %} {% set _value = value|default('') %} {% set _disabled = disabled|default(false) %} {% set _invalid = invalid|default(false) %} {% set _checked = checked|default(false) %} {% set _helper_id = helper_id|default('') %} {% set _helper_text = helper_text|default('') %} {% set _label = label|default('') %} {% set _icon_path = icon_path|default('') %} {% set _css_class = 'ecl-checkbox' %} {% set _extra_attributes = '' %} {% set _extra_input_attributes = '' %} {% set _required = false %} {# Internal logic - Process properties #} {% if _disabled %} {% set _css_class = _css_class ~ ' ecl-checkbox--disabled' %} {% endif %} {% if _invalid %} {% set _css_class = _css_class ~ ' ecl-checkbox--invalid' %} {% endif %} {% if extra_classes is defined and extra_classes is not empty %} {% set _css_class = _css_class ~ ' ' ~ extra_classes %} {% endif %} {% if extra_attributes is defined and extra_attributes is not empty and extra_attributes is iterable %} {% for attr in extra_attributes %} {% set _extra_attributes = _extra_attributes ~ ' ' ~ attr.name ~ '="' ~ attr.value ~ '"' %} {% endfor %} {% endif %} {% if extra_input_attributes is defined and extra_input_attributes is not empty and extra_input_attributes is iterable %} {% for attr in extra_input_attributes %} {% set _extra_input_attributes = _extra_input_attributes ~ ' ' ~ attr.name ~ '="' ~ attr.value ~ '"' %} {% if attr.name == 'required' %} {% set _required = true %} {% endif %} {% endfor %} {% endif %} {# Print the result #}
{%- block helper_text _helper_text -%}
{% endif %}