vartheme_bs5-2.0.x-dev/src/components/atoms/form/input/input.twig

src/components/atoms/form/input/input.twig
{#
/**
 * @file
 * Theme override for an 'input' #type form element.
 *
 * Available variables:
 * - attributes: A list of HTML attributes for the input element.
 * - children: Optional additional rendered elements.
 *
 * @see template_preprocess_input()
  * for checkboxes and radio buttons.
  * - utility_classes: An array of utility classes.
  * - form_control: A class 'form-control' related to input type.
 */
#}

{% set form_control = form_control ? ['form-control'] : [] %}
{% set utility_classes = utility_classes ? utility_classes : [] %}
{% set type = type ?? 'text' %}
{% set size = size ?? '' %}
{% set placeholder = placeholder ?? '' %}
{% set classes = []|merge(form_control)|merge(utility_classes)|merge([size]) %}

{# To render drupal Input component #}
{% if attributes %}
  <input{{ attributes.addClass(classes) }} />{{ children }}
{# To render Storybook Input component #}
{% else %}
  <input type="{{ type }}" class="{{ classes|join(' ') }}" placeholder="{{ placeholder }}" />
{% endif %}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc