4 * Theme override for a select element.
7 * - attributes: HTML attributes for the <select> tag.
8 * - options: The <option> element children.
10 * @see template_preprocess_select()
14 <select{{ attributes }}>
15 {% for option in options %}
16 {% if option.type == 'optgroup' %}
17 <optgroup label="{{ option.label }}">
18 {% for sub_option in option.options %}
19 <option value="{{ sub_option.value }}"{{ sub_option.selected ? ' selected="selected"' }}>{{ sub_option.label }}</option>
22 {% elseif option.type == 'option' %}
23 <option value="{{ option.value }}"{{ option.selected ? ' selected="selected"' }}>{{ option.label }}</option>