Class: HTML_QuickForm
Source Location: /HTML_QuickForm-3.2.14/QuickForm.php
HTML_Common
|
--HTML_QuickForm
Create, validate and process HTML forms
Author(s):
Version:
|
|
|
Inherited Variables
|
Inherited Methods
|
Class Details
Class Variables
Method Detail
HTML_QuickForm (Constructor) [line 284]
HTML_QuickForm HTML_QuickForm(
[string
$formName = ''], [string
$method = 'post'], [string
$action = ''], [string
$target = ''], [mixed
$attributes = null], [bool
$trackSubmit = false])
|
|
Class constructor
Parameters:
accept [line 1680]
void accept(
object An
&$renderer)
|
|
Accepts a renderer
Parameters:
addElement [line 626]
HTML_QuickForm_Element &addElement(
mixed
$element)
|
|
Adds an element into the form If $element is a string representing element type, then this method accepts variable number of parameters, their meaning and count depending on $element
Parameters:
addFormRule [line 1221]
void addFormRule(
mixed
$rule)
|
|
Adds a global validation rule This should be used when for a rule involving several fields or if you want to use some completely custom validation for your form. The rule function/method should return true in case of successful validation and array('element name' => 'error') when there were errors.
Parameters:
addGroup [line 749]
HTML_QuickForm_group &addGroup(
array
$elements, [string
$name = null], [string
$groupLabel = ''], [string
$separator = null], [string
$appendName = true])
|
|
Adds an element group
Parameters:
addGroupRule [line 1131]
void addGroupRule(
string
$group, mixed
$arg1, [string
$type = ''], [string
$format = null], [int
$howmany = 0], [string
$validation = 'server'], [bool
$reset = false])
|
|
Adds a validation rule for the given group of elements Only groups with a name can be assigned a validation rule Use addGroupRule when you need to validate elements inside the group. Use addRule if you need to validate the group as a whole. In this case, the same rule will be applied to all elements in the group. Use addRule if you need to validate the group against a function.
Parameters:
addRule [line 1065]
void addRule(
string
$element, string
$message, string
$type, [string
$format = null], [string
$validation = 'server'], [boolean
$reset = false], [boolean
$force = false])
|
|
Adds a validation rule for the given field If the element is in fact a group, it will be considered as a whole. To validate grouped elements as separated entities, use addGroupRule instead of addRule.
Parameters:
apiVersion [line 342]
Returns the current API version
applyFilter [line 1241]
void applyFilter(
mixed
$element, mixed
$filter)
|
|
Applies a data filter for the given field(s)
Parameters:
arrayMerge [line 1309]
array arrayMerge(
array
$a, array
$b)
|
|
Merges two arrays Merges two array like the PHP function array_merge but recursively. The main difference is that existing keys will not be renumbered if they are integers.
Parameters:
createElement [line 566]
HTML_QuickForm_Element &createElement(
string
$elementType)
|
|
Creates a new form element of the given type. This method accepts variable number of parameters, their meaning and count depending on $elementType
Parameters:
defaultRenderer [line 1703]
object a &defaultRenderer(
)
|
|
Returns a reference to default renderer object
elementExists [line 397]
boolean elementExists(
[string
$element = null])
|
|
Returns true if element is in the form
Parameters:
errorMessage [line 1990]
string errorMessage(
int
$value)
|
|
Return a textual error message for an QuickForm error code
Parameters:
exportValue [line 1884]
mixed exportValue(
string
$element)
|
|
Returns a 'safe' element's value This method first tries to find a cleaned-up submitted value, it will return a value set by setValue()/setDefaults()/setConstants() if submitted value does not exist for the given element.
Parameters:
exportValues [line 1918]
array exportValues(
[mixed
$elementList = null])
|
|
Returns 'safe' elements' values Unlike getSubmitValues(), this will return only the values corresponding to the elements present in the form.
Parameters:
freeze [line 1606]
void freeze(
[mixed
$elementList = null])
|
|
Displays elements without HTML input tags
Parameters:
getElement [line 773]
Returns a reference to the element
Parameters:
getElementError [line 924]
string getElementError(
string
$element)
|
|
Returns error corresponding to validated element
Parameters:
getElementType [line 963]
string getElementType(
string
$element)
|
|
Returns the type of the given element
Parameters:
getElementValue [line 798]
mixed &getElementValue(
string
$element)
|
|
Returns the element's raw value This returns the value as submitted by the form (not filtered) or set via setDefaults() or setConstants()
Parameters:
getMaxFileSize [line 546]
Returns the value of MAX_FILE_SIZE hidden element
getRegisteredRules [line 1409]
array getRegisteredRules(
)
|
|
Returns an array of registered validation rules
getRegisteredTypes [line 1354]
array getRegisteredTypes(
)
|
|
Returns an array of registered element types
getRequiredNote [line 1493]
string getRequiredNote(
)
|
|
Returns the required note
getSubmitValue [line 830]
mixed getSubmitValue(
string
$elementName)
|
|
Returns the elements value after submit and filter
Parameters:
getSubmitValues [line 1843]
array getSubmitValues(
[bool
$mergeFiles = false])
|
|
Returns the values submitted by the form
Parameters:
getValidationScript [line 1745]
string getValidationScript(
)
|
|
Returns the client side validation script
insertElementBefore [line 682]
Inserts a new element right before the other element Warning: it is not possible to check whether the $element is already added to the form, therefore if you want to move the existing form element to a new position, you'll have to use removeElement(): $form->insertElementBefore($form->removeElement('foo', false), 'bar');
Parameters:
isElementFrozen [line 1441]
boolean isElementFrozen(
string
$element)
|
|
Returns whether or not the form element is frozen
Parameters:
isElementRequired [line 1425]
boolean isElementRequired(
string
$element)
|
|
Returns whether or not the form element is required
Parameters:
isError [line 1974]
bool isError(
mixed
$value)
|
|
Tell whether a result from a QuickForm method is an error (an instance of HTML_QuickForm_Error)
Parameters:
isFrozen [line 1642]
Returns whether or not the whole form is frozen
isRuleRegistered [line 1371]
mixed isRuleRegistered(
string
$name, [bool
$autoRegister = false])
|
|
Returns whether or not the given rule is supported
Parameters:
isSubmitted [line 1957]
Tells whether the form was already submitted This is useful since the _submitFiles and _submitValues arrays may be completely empty after the trackSubmit value is removed.
isTypeRegistered [line 1339]
boolean isTypeRegistered(
string
$type)
|
|
Returns whether or not the form element type is supported
Parameters:
process [line 1660]
mixed process(
mixed
$callback, [bool
$mergeFiles = true])
|
|
Performs the form data processing
Parameters:
registerElementType [line 360]
void registerElementType(
string
$typeName, string
$include, string
$className)
|
|
Registers a new element type
Parameters:
registerRule [line 379]
void registerRule(
string
$ruleName, string
$type, string
$data1, [string
$data2 = null])
|
|
Registers a new validation rule
Parameters:
removeElement [line 1019]
Removes an element The method "unlinks" an element from the form, returning the reference to the element object. If several elements named $elementName exist, it removes the first one, leaving the others intact.
Parameters:
setConstants [line 487]
void setConstants(
[array
$constantValues = null], [mixed
$filter = null])
|
|
Initializes constant form values. These values won't get overridden by POST or GET vars
Parameters:
setDatasource [line 419]
void setDatasource(
&$datasource, [mixed
$defaultsFilter = null], [mixed
$constantsFilter = null], object
$datasource)
|
|
Sets a datasource object for this form object Datasource default and constant values will feed the QuickForm object if the datasource implements defaultValues() and constantValues() methods.
Parameters:
setDefaults [line 447]
void setDefaults(
[array
$defaultValues = null], [mixed
$filter = null])
|
|
Initializes default form values
Parameters:
setElementError [line 943]
void setElementError(
string
$element, [string
$message = null])
|
|
Set error message for a form element
Parameters:
setJsWarnings [line 1461]
void setJsWarnings(
string
$pref, string
$post)
|
|
Sets JavaScript warning messages
Parameters:
setMaxFileSize [line 523]
void setMaxFileSize(
[int
$bytes = 0])
|
|
Sets the value of MAX_FILE_SIZE hidden element
Parameters:
setRequiredNote [line 1478]
void setRequiredNote(
string
$note)
|
|
Sets required-note
Parameters:
toArray [line 1861]
array toArray(
[bool
$collectHidden = false])
|
|
Returns the form's contents in an array. The description of the array structure is in HTML_QuickForm_Renderer_Array docs
Parameters:
toHtml [line 1725]
string toHtml(
[string
$in_data = null])
|
|
Returns an HTML version of the form
Parameters:
updateElementAttr [line 983]
void updateElementAttr(
mixed
$elements, mixed
$attrs)
|
|
Updates Attributes for one or more elements
Parameters:
validate [line 1508]
Performs the server side validation
Documentation generated on Mon, 11 Mar 2019 15:59:48 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|
|