{# /** * @file * Default theme implementation for a form element label. * * Available variables: * - element: an input element. * - title: The label's text. * - title_display: Elements title_display setting. * - description: element description. * - required: An indicator for whether the associated form element is required. * - attributes: A list of HTML attributes for the label. * * @see template_preprocess_form_element_label() * * @ingroup templates */ #} {%- set classes = [ 'control-label', title_display == 'after' ? 'option', title_display == 'invisible' ? 'sr-only', required ? 'js-form-required', required ? 'form-required', ] -%} {%- if title is not empty or required -%} {{ element }}{{ title }} {%- if description -%}

{{ description }}

{%- endif -%} {%- if required and title_display == 'before' or title_display == 'after'-%} * {%- endif -%} {%- endif -%}