textarea.html.twig

Same filename in this branch
  1. 11.x core/profiles/demo_umami/themes/umami/templates/classy/form/textarea.html.twig
  2. 11.x core/themes/stable9/templates/form/textarea.html.twig
  3. 11.x core/themes/starterkit_theme/templates/form/textarea.html.twig
  4. 11.x core/modules/system/templates/textarea.html.twig
Same filename in other branches
  1. 9 core/profiles/demo_umami/themes/umami/templates/classy/form/textarea.html.twig
  2. 9 core/themes/stable9/templates/form/textarea.html.twig
  3. 9 core/themes/seven/templates/classy/form/textarea.html.twig
  4. 9 core/themes/claro/templates/form/textarea.html.twig
  5. 9 core/themes/bartik/templates/classy/form/textarea.html.twig
  6. 9 core/themes/stable/templates/form/textarea.html.twig
  7. 9 core/themes/starterkit_theme/templates/form/textarea.html.twig
  8. 9 core/themes/classy/templates/form/textarea.html.twig
  9. 9 core/modules/system/templates/textarea.html.twig
  10. 8.9.x core/profiles/demo_umami/themes/umami/templates/classy/form/textarea.html.twig
  11. 8.9.x core/themes/seven/templates/classy/form/textarea.html.twig
  12. 8.9.x core/themes/claro/templates/classy/form/textarea.html.twig
  13. 8.9.x core/themes/bartik/templates/classy/form/textarea.html.twig
  14. 8.9.x core/themes/stable/templates/form/textarea.html.twig
  15. 8.9.x core/themes/classy/templates/form/textarea.html.twig
  16. 8.9.x core/modules/system/templates/textarea.html.twig
  17. 10 core/profiles/demo_umami/themes/umami/templates/classy/form/textarea.html.twig
  18. 10 core/themes/stable9/templates/form/textarea.html.twig
  19. 10 core/themes/claro/templates/form/textarea.html.twig
  20. 10 core/themes/starterkit_theme/templates/form/textarea.html.twig
  21. 10 core/modules/system/templates/textarea.html.twig

Theme override for a 'textarea' #type form element.

Available variables

  • wrapper_attributes: A list of HTML attributes for the wrapper element.
  • attributes: A list of HTML attributes for the <textarea> element.
  • resizable: An indicator for whether the textarea is resizable.
  • required: An indicator for whether the textarea is required.
  • value: The textarea content.

See also

template_preprocess_textarea()

1 theme call to textarea.html.twig
Textarea::getInfo in core/lib/Drupal/Core/Render/Element/Textarea.php
Returns the element properties for this element.

File

core/themes/claro/templates/form/textarea.html.twig

View source
  1. {#
  2. /**
  3. * @file
  4. * Theme override for a 'textarea' #type form element.
  5. *
  6. * Available variables
  7. * - wrapper_attributes: A list of HTML attributes for the wrapper element.
  8. * - attributes: A list of HTML attributes for the <textarea> element.
  9. * - resizable: An indicator for whether the textarea is resizable.
  10. * - required: An indicator for whether the textarea is required.
  11. * - value: The textarea content.
  12. *
  13. * @see template_preprocess_textarea()
  14. */
  15. #}
  16. {%
  17. set classes = [
  18. 'form-textarea',
  19. resizable ? 'resize-' ~ resizable,
  20. required ? 'required',
  21. 'form-element',
  22. 'form-element--type-textarea',
  23. 'form-element--api-textarea',
  24. ]
  25. %}
  26. <div{{ wrapper_attributes.addClass('form-textarea-wrapper') }}>
  27. <textarea{{ attributes.addClass(classes) }}>{{ value }}</textarea>
  28. </div>

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.