file input.html.twig

Default theme implementation for an 'input' type form element.

Available variables:

  • attributes: A list of HTML attributes for the input element.
  • children: Optional additional rendered elements.
  • icon: An icon.
  • input_group: Flag to display as an input group.
  • icon_position: Where an icon should be displayed.
  • prefix: Markup to display before the input element.
  • suffix: Markup to display after the input element.
  • type: The type of input.

See Also

Source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation for an 'input' #type form element.
  5. *
  6. * Available variables:
  7. * - attributes: A list of HTML attributes for the input element.
  8. * - children: Optional additional rendered elements.
  9. * - icon: An icon.
  10. * - input_group: Flag to display as an input group.
  11. * - icon_position: Where an icon should be displayed.
  12. * - prefix: Markup to display before the input element.
  13. * - suffix: Markup to display after the input element.
  14. * - type: The type of input.
  15. *
  16. * @ingroup templates
  17. *
  18. * @see \Drupal\bootstrap\Plugin\Preprocess\Input
  19. * @see template_preprocess_input()
  20. */
  21. #}
  22. {% spaceless %}
  23. {% if input_group %}
  24. <div class="input-group">
  25. {% endif %}
  26. {% if prefix %}
  27. {{ prefix }}
  28. {% endif %}
  29. {% block input %}
  30. <input{{ attributes }} />
  31. {% endblock %}
  32. {% if suffix %}
  33. {{ suffix }}
  34. {% endif %}
  35. {% if input_group %}
  36. </div>
  37. {% endif %}
  38. {{ children }}
  39. {% endspaceless %}

Related topics