You are here

function drupal_render_form in Drupal 5

Same name and namespace in other branches
  1. 6 includes/form.inc \drupal_render_form()

Renders a structured form array into themed HTML.

Parameters

$form_id: A unique string identifying the form for validation, submission, theming, and hook_form_alter functions.

$form: An associative array containing the structure of the form.

Return value

A string containing the path of the page to display when processing is complete.

Related topics

1 call to drupal_render_form()
drupal_get_form in includes/form.inc
Retrieves a form from a builder function, passes it on for processing, and renders the form or redirects to its destination as appropriate. In multi-step form scenarios, it handles properly processing the values using the previous step's form…

File

includes/form.inc, line 454

Code

function drupal_render_form($form_id, &$form) {

  // Don't override #theme if someone already set it.
  if (isset($form['#base'])) {
    $base = $form['#base'];
  }
  if (!isset($form['#theme'])) {
    if (theme_get_function($form_id)) {
      $form['#theme'] = $form_id;
    }
    elseif (theme_get_function($base)) {
      $form['#theme'] = $base;
    }
  }
  if (isset($form['#pre_render'])) {
    foreach ($form['#pre_render'] as $function) {
      if (function_exists($function)) {
        $function($form_id, $form);
      }
    }
  }
  $output = drupal_render($form);
  return $output;
}