{%- set options = (options is defined ? options : []) %} {%- set value = (value is defined ? value : null) %} {%- set hasOptgroups = false -%}
{% for key, option in options %} {% set optionLabel = (option.label is defined ? option.label : option) %} {% set optionValue = (option.value is defined ? option.value : key) %} {% set optionDisabled = (option.disabled is defined ? option.disabled : false) %} {% endfor %} {% apply spaceless %} {% for key, option in options %} {% set optionLabel = (option.label is defined ? option.label : option) %} {% set optionValue = (option.value is defined ? option.value : key) %} {% if optionValue == value %} {{ optionLabel }} {% endif %} {% endfor %} {% endapply %}