auFormElement: Difference between revisions
Misterhaan (talk | contribs) New page: {{RightTOC}} FormElement Category:Class Category:PHP The auFormElement class is part of the auLib package. It is defined in the auForm.php file and used as ... |
Misterhaan (talk | contribs) |
||
Line 31: | Line 31: | ||
===CheckInput=== | ===CheckInput=== | ||
<code>CheckInput()</code> | <code>CheckInput()</code> | ||
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. | 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. | * @return = Whether the element has errors. | ||
Line 36: | Line 37: | ||
===GetErrors=== | ===GetErrors=== | ||
<code>GetErrors()</code> | <code>GetErrors()</code> | ||
Gets the error with the element, if any. | Gets the error with the element, if any. | ||
* @return = Error text, or false. | * @return = Error text, or false. | ||
Line 41: | Line 43: | ||
===GetLabel=== | ===GetLabel=== | ||
<code>GetLabel()</code> | <code>GetLabel()</code> | ||
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. | 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. | * @return = Label of the element. |
Revision as of 14:22, 16 April 2008
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.
Usage
There is not generally a reason to use auFormElement directly, so a list of descendant classes is also included on this page:
- auForm (note that an auForm object can not be added to an auFormContainer.)
- auFormFieldset
- auFormData
- auFormText
- auFormHTML
- auFormField (this is going to be split up and replaced with an abstract class.)
- auFormButtons
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.