[drupal-devel] [task] New drupal forms api.
drupal-devel at drupal.org
Tue Aug 23 11:40:06 UTC 2005
Issue status update for
Post a follow up:
Component: base system
Assigned to: adrian
Reported by: adrian
Updated by: adrian
Status: patch (code needs work)
Attachment: http://drupal.org/files/issues/form.inc (20.53 KB)
This is the first check in of the new forms api code.
The system has been designed to co-exist with the current forms api,
and is contained in a new
include file (includes/form.inc).
Forms are now defined in their component arrays, similar to how menu
items are defined.
$form['body'] = array(type => 'textarea', default_value =>
$node->body, cols => 60, rows => 60);
Elements can also be nested, and the $edit follows this definition. For
$form['author'] = array(type => 'fieldset', title => t('Authoring
information'), collapsible => TRUE, collapsed => TRUE, weight => -1);
$form['author']['name'] = array(type => 'textfield', title =>
t('Authored by'), maxlength => 60,
=> 'user/autocomplete', default_value => $node->name, weight => -1);
All the properties used are defined as constants, and are documented
for each of the elements, and individually.
More information about the drupal-devel