{# /** * @file * Theme override for a select element. * * Available variables: * - attributes: HTML attributes for the select tag. * - input_group: Flag to display as an input group. * - options: The option element children. * - prefix: Markup to display before the input element. * - suffix: Markup to display after the input element. * * @ingroup templates * * @see template_preprocess_select() */ #} {% spaceless %} {% if input_group %}
{% endif %} {% if prefix %} {{ prefix }} {% endif %} {# Browsers do not recognize pseudo :after selectors, we must create a wrapper # around the select element to style it properly. # @see http://stackoverflow.com/q/21103542 #} {% if not attributes.offsetExists('multiple') %}
{% endif %} {% set classes = ['form-control'] %} {% for option in options %} {% if option.type == 'optgroup' %} {% for sub_option in option.options %} {% endfor %} {% elseif option.type == 'option' %} {% endif %} {% endfor %} {% if not attributes.offsetExists('multiple') %}
{% endif %} {% if suffix %} {{ suffix }} {% endif %} {% if input_group %}
{% endif %} {% endspaceless %}