diff options
author | Neil Drumm <drumm@3064.no-reply.drupal.org> | 2006-11-26 22:35:20 +0000 |
---|---|---|
committer | Neil Drumm <drumm@3064.no-reply.drupal.org> | 2006-11-26 22:35:20 +0000 |
commit | 8bf48bf999c6c496679acda7dca7e1cc35cafed6 (patch) | |
tree | 75cf6483e4148b8d4964aa3907dbccb69cd548b2 /includes | |
parent | a6f6ddcc4aade82ea594481f8fbcaaf4d7f71708 (diff) | |
download | brdo-8bf48bf999c6c496679acda7dca7e1cc35cafed6.tar.gz brdo-8bf48bf999c6c496679acda7dca7e1cc35cafed6.tar.bz2 |
#99645 by chx. Reshuffle some comments.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/form.inc | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/includes/form.inc b/includes/form.inc index 9fae90b07..818e0fc75 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -17,25 +17,8 @@ * $output = drupal_get_form('user_register'); * * Forms can also be built and submitted programmatically without any user input - * using the drupal_execute() function. Pass in the id of the form, the values to - * submit to the form, and any parameters needed by the form's builder function. - * For example: + * using the drupal_execute() function. * - * // register a new user - * $values['name'] = 'robo-user'; - * $values['mail'] = 'robouser@example.com'; - * $values['pass'] = 'password'; - * drupal_execute('user_register', $values); - * - * // Create a new node - * $node = array('type' => 'story'); - * $values['title'] = 'My node'; - * $values['body'] = 'This is the body text!'; - * $values['name'] = 'robo-user'; - * drupal_execute('story_node_form', $values, $node); - * - * Calling form_get_errors() after execution will return an array of any - * validation errors encountered. * * For information on the format of the structured arrays used to define forms, * and more detailed explanations of the Form API workflow, see the reference at @@ -133,6 +116,21 @@ function drupal_get_form($form_id) { * Any additional arguments needed by the form building function. * @return * Any form validation errors encountered. + * + * For example: + * + * // register a new user + * $values['name'] = 'robo-user'; + * $values['mail'] = 'robouser@example.com'; + * $values['pass'] = 'password'; + * drupal_execute('user_register', $values); + * + * // Create a new node + * $node = array('type' => 'story'); + * $values['title'] = 'My node'; + * $values['body'] = 'This is the body text!'; + * $values['name'] = 'robo-user'; + * drupal_execute('story_node_form', $values, $node); */ function drupal_execute($form_id, $form_values) { $args = func_get_args(); |