theme_button

Versions
5 – 6
theme_button($element)
7
theme_button($variables)

Theme a button form element.

Parameters

$variables An associative array containing:

  • element: An associative array containing the properties of the element. Properties used: #attributes, #button_type, #name, #value.

Return value

A themed HTML string representing the form element.

Related topics

Code

7/includes/form.inc, line 2676

<?php
function theme_button($variables) {
  $element = $variables['element'];
  $element['#attributes']['class'][] = 'form-' . $element['#button_type'];

  return '<input type="submit" ' . (empty($element['#name']) ? '' : 'name="' . $element['#name'] . '" ') . 'id="' . $element['#id'] . '" value="' . check_plain($element['#value']) . '" ' . drupal_attributes($element['#attributes']) . " />\n";
}
?>