HTMLForm Class Reference

Object handling generic submission, CSRF protection, layout and other logic for UI forms. More...

Inherited by PreferencesForm, and UploadForm.

List of all members.

Static Public Attributes

static $jsAdded = false


Detailed Description

Object handling generic submission, CSRF protection, layout and other logic for UI forms.

in a reusable manner.

In order to generate the form, the HTMLForm object takes an array structure detailing the form fields available. Each element of the array is a basic property-list, including the type of field, the label it is to be given in the form, callbacks for validation and 'filtering', and other pertinent information.

Field types are implemented as subclasses of the generic HTMLFormField object, and typically implement at least getInputHTML, which generates the HTML for the input field to be placed in the table.

The constructor input is an associative array of $fieldname => $info, where $info is an Associative Array with any of the following:

'class' -- the subclass of HTMLFormField that will be used to create the object. *NOT* the CSS class! 'type' -- roughly translates into the <select> type attribute. if 'class' is not specified, this is used as a map through HTMLForm::$typeMappings to get the class name. 'default' -- default value when the form is displayed 'id' -- HTML id attribute 'options' -- varies according to the specific object. 'label-message' -- message key for a message to use as the label. can be an array of msg key and then parameters to the message. 'label' -- alternatively, a raw text message. Overridden by label-message 'help-message' -- message key for a message to use as a help text. can be an array of msg key and then parameters to the message. 'required' -- passed through to the object, indicating that it is a required field. 'size' -- the length of text fields 'filter-callback -- a function name to give you the chance to massage the inputted value before it's processed.

See also:
HTMLForm::filter() 'validation-callback' -- a function name to give you the chance to impose extra validation on the field input.

HTMLForm::validate()

TODO: Document 'section' / 'subsection' stuff

Definition at line 48 of file HTMLForm.php.


Member Data Documentation

HTMLForm::$jsAdded = false [static]

Definition at line 49 of file HTMLForm.php.


The documentation for this class was generated from the following file:

Generated on Sat Apr 30 22:57:39 2011 for MediaWiki by  doxygen 1.5.9