form
- Versions
- 4.6
form($form, $method = 'post', $action = NULL, $attributes = NULL)
Generate a form from a set of form elements.
@result An HTML string with the contents of $form wrapped in a form tag.
Parameters
$form An HTML string containing one or more form elements.
$method The query method to use ("post" or "get").
$action The URL to send the form contents to, if not the current page.
$attributes An associative array of attributes to add to the form tag.
Related topics
Code
includes/common.inc, line 999
<?php
function form($form, $method = 'post', $action = NULL, $attributes = NULL) {
if (!$action) {
$action = request_uri();
}
return '<form action="'. check_url($action) .'" method="'. $method .'"'. drupal_attributes($attributes) .">\n". $form . form_token() ."\n</form>\n";
}
?>Login or register to post comments 