function theme_textarea

Returns HTML for a textarea form element.

Parameters

$variables: An associative array containing:

  • element: An associative array containing the properties of the element. Properties used: #title, #value, #description, #rows, #cols, #placeholder, #required, #attributes, #resizable

Related topics

1 theme call to theme_textarea()
system_element_info in drupal/core/modules/system/system.module
Implements hook_element_info().

File

drupal/core/includes/form.inc, line 4348
Functions for form and batch generation and processing.

Code

function theme_textarea($variables) {
  $element = $variables['element'];
  element_set_attributes($element, array(
    'id',
    'name',
    'rows',
    'cols',
    'placeholder',
  ));
  _form_set_attributes($element, array(
    'form-textarea',
  ));
  $wrapper_attributes = array(
    'class' => array(
      'form-textarea-wrapper',
    ),
  );

  // Add resizable behavior.
  if (!empty($element['#resizable'])) {
    $element['#attributes']['class'][] = 'resize-' . $element['#resizable'];
  }
  $output = '<div' . new Attribute($wrapper_attributes) . '>';
  $output .= '<textarea' . new Attribute($element['#attributes']) . '>' . check_plain($element['#value']) . '</textarea>';
  $output .= '</div>';
  return $output;
}