theme_form

Versions
4.7 – 6
theme_form($element)
7
theme_form($variables)

Theme a form.

Parameters

$variables An associative array containing:

  • element: An associative array containing the properties of the element. Properties used: #action, #method, #attributes, #children

Return value

A themed HTML string representing the form.

Related topics

Code

includes/form.inc, line 2690

<?php
function theme_form($variables) {
  $element = $variables['element'];
  // Anonymous div to satisfy XHTML compliance.
  $action = $element['#action'] ? 'action="' . check_url($element['#action']) . '" ' : '';
  return '<form ' . $action . ' accept-charset="UTF-8" method="' . $element['#method'] . '" id="' . $element['#id'] . '"' . drupal_attributes($element['#attributes']) . ">\n<div>" . $element['#children'] . "\n</div></form>\n";
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.