flow2-8.x-4.0-beta3/templates/input/input--submit.html.twig

templates/input/input--submit.html.twig
{#
/**
 * @file
 * Theme suggestion for "button" input form element.
 *
 * Available variables:
 * - attributes: A list of HTML attributes for the input element.
 * - children: Optional additional rendered elements.
 * - icon: An icon.
 * - icon_only: Flag to display only the icon and not the label.
 * - icon_position: Where an icon should be displayed.
 * - label: button label.
 * - prefix: Markup to display before the input element.
 * - suffix: Markup to display after the input element.
 * - type: The type of input.
 *
 * @ingroup templates
 *
 * @see \Drupal\bootstrap\Plugin\Preprocess\InputButton
 * @see \Drupal\bootstrap\Plugin\Preprocess\Input
 * @see template_preprocess_input()
 */
#}
{% spaceless %}
  {%
    set classes = [
      'btn',
      type == 'submit' ? 'js-form-submit',
      icon and icon_position and not icon_only ? 'icon-' ~ icon_position,
    ]
  %}
  {% block input %}
    {% if icon and icon_only %}
      <button{{ attributes.addClass(classes, 'icon-only') }}>
        <span class="sr-only">{{ label }}</span>
        <i class="fas"></i>
      </button>
    {% else %}
      {% if icon_position == 'after' %}
        <button{{ attributes.addClass(classes) }}>{{ label }}<i class="fas"></i></button>{{ children }}
      {% else %}
        <button{{ attributes.addClass(classes) }}><i class="fas"></i>{{ label }}</button>{{ children }}
      {% endif %}
    {% endif %}
    {{ children }}
  {% endblock %}
{% endspaceless %}

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

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