function theme_form

7.x theme_form($variables)
5.x theme_form($element)
6.x theme_form($element)

Returns HTML for a form.


$variables: An associative array containing:

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

Related topics

91 string references to the theme hook from theme_form()

Note: this list is generated by looking for the string for this theme hook, so it may include some references that are not actually using this theme hook.

aggregator_theme in drupal/modules/aggregator/aggregator.module
Implements hook_theme().
block_theme in drupal/modules/block/block.module
Implements hook_theme().
book_theme in drupal/modules/book/book.module
Implements hook_theme().
color_theme in drupal/modules/color/color.module
Implements hook_theme().
CommentInterfaceTest::assertCommentLinks in drupal/modules/comment/comment.test
Asserts that comment links appear according to the passed environment setup.

... See full list


drupal/includes/, line 3924
Functions for form and batch generation and processing.


function theme_form($variables) {
  $element = $variables['element'];
  if (isset($element['#action'])) {
    $element['#attributes']['action'] = drupal_strip_dangerous_protocols($element['#action']);
  element_set_attributes($element, array('method', 'id'));
  if (empty($element['#attributes']['accept-charset'])) {
    $element['#attributes']['accept-charset'] = "UTF-8";
  // Anonymous DIV to satisfy XHTML compliance.
  return '<form' . drupal_attributes($element['#attributes']) . '><div>' . $element['#children'] . '</div></form>';