Jump to content

auFormElement: Difference between revisions

From auWiki
No edit summary
 
(One intermediate revision by the same user not shown)
Line 3: Line 3:
[[Category:Class]]
[[Category:Class]]
[[Category:PHP]]
[[Category:PHP]]
The auFormElement class is part of the [[auLib]] package.  It is defined in the auForm.php file and used as the base class for every other class in that file.
The auFormElement abstract class is part of the [[auLib]] package.  It is defined in the auForm.php file and used as the base class for every other class in that file.


==Usage==
==Usage==
Line 14: Line 14:
* [[auFormText]]
* [[auFormText]]
* [[auFormHTML]]
* [[auFormHTML]]
* [[auFormField]] (this is going to be split up and replaced with an abstract class.)
* [[auFormField]]
** [[auFormString]]
** [[auFormString]]
** [[auFormMultiString]]
** [[auFormMultiString]]
** [[auFormPassword]]
** [[auFormNumber]]
*** [[auFormInteger]]
** [[auFormInstant]]
** [[auFormCheckbox]]
** [[auFormFile]]
** [[auFormSelect]]
** [[auFormSelect]]
** [[auFormMultiSelect]]
** [[auFormMultiSelect]]

Latest revision as of 13:53, 22 April 2008

The auFormElement abstract class is part of the auLib package. It is defined in the auForm.php file and used as the base class for every other class in that file.

Usage

There is not generally a reason to use auFormElement directly, so a list of descendant classes is also included on this page:

Protected Data

$ownerForm

The form object this element belongs to.

$parent

The container that immediately contains this element.

$error

The error message for this element, or false if no errors have been found.

Protected Functions

CheckInput

CheckInput()

Checks the element value for errors. This needs to be overridden to actually do the check, otherwise it always returns true. If an error is found, the message should be saved in $this->error.

  • @return = Whether the element has errors.

GetErrors

GetErrors()

Gets the error with the element, if any.

  • @return = Error text, or false.

GetLabel

GetLabel()

Gets the label of the element, if any. This needs to be overridden for elements that have labels, otherwise it always returns an empty string.

  • @return = Label of the element.

WriteHTML

WriteHTML()

This is an abstract function, so all non-abstract classes that extend auFormElement must provide this function. It should write out the HTML for the element.