Class: HTML_QuickForm
Source Location: /HTML_QuickForm-3.2.2/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 248]
HTML_QuickForm HTML_QuickForm(
[string
$formName = ''], [string
$method = 'post'], [string
$action = ''], [string
$target = '_self'], [mixed
$attributes = null], [bool
$trackSubmit = false])
|
|
Class constructor
Parameters:
accept [line 1468]
void accept(
object An
&$renderer)
|
|
Accepts a renderer
Parameters:
addElement [line 559]
object reference &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 1040]
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 606]
object reference &addGroup(
array
$elements, [string
$name = null], [string
$groupLabel = ''], [string
$separator = null], [string
$appendName = true])
|
|
Adds an element group
Parameters:
addGroupRule [line 953]
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 887]
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 280]
Returns the current API version
applyFilter [line 1059]
void applyFilter(
mixed
$element, mixed
$filter)
|
|
Applies a data filter for the given field(s)
Parameters:
arrayMerge [line 1124]
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 501]
object extended &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 1494]
object a &defaultRenderer(
)
|
|
Returns a reference to default renderer object
elementExists [line 335]
boolean elementExists(
[string
$element = null])
|
|
Returns true if element is in the form
Parameters:
errorMessage [line 1743]
string errorMessage(
int
$value)
|
|
Return a textual error message for an QuickForm error code
Parameters:
exportValue [line 1657]
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 1691]
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 1394]
void freeze(
[mixed
$elementList = null])
|
|
Displays elements without HTML input tags
Parameters:
getElement [line 629]
object reference &getElement(
string
$element)
|
|
Returns a reference to the element
Parameters:
getElementError [line 765]
string getElementError(
string
$element)
|
|
Returns error corresponding to validated element
Parameters:
getElementType [line 800]
string getElementType(
string
$element)
|
|
Returns the type of the given element
Parameters:
getElementValue [line 653]
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 481]
Returns the value of MAX_FILE_SIZE hidden element
getRegisteredRules [line 1224]
array getRegisteredRules(
)
|
|
Returns an array of registered validation rules
getRegisteredTypes [line 1169]
array getRegisteredTypes(
)
|
|
Returns an array of registered element types
getRequiredNote [line 1308]
string getRequiredNote(
)
|
|
Returns the required note
getSubmitValue [line 684]
mixed getSubmitValue(
string
$elementName)
|
|
Returns the elements value after submit and filter
Parameters:
getSubmitValues [line 1618]
array getSubmitValues(
[bool
$mergeFiles = false])
|
|
Returns the values submitted by the form
Parameters:
getValidationScript [line 1536]
string getValidationScript(
)
|
|
Returns the client side validation script
isElementFrozen [line 1256]
boolean isElementFrozen(
string
$element)
|
|
Returns whether or not the form element is frozen
Parameters:
isElementRequired [line 1240]
boolean isElementRequired(
string
$element)
|
|
Returns whether or not the form element is required
Parameters:
isError [line 1728]
bool isError(
mixed
$value)
|
|
Tell whether a result from a QuickForm method is an error (an instance of HTML_QuickForm_Error)
Parameters:
isFrozen [line 1431]
Returns whether or not the whole form is frozen
isRuleRegistered [line 1186]
mixed isRuleRegistered(
string
$name, [bool
$autoRegister = false])
|
|
Returns whether or not the given rule is supported
Parameters:
isTypeRegistered [line 1154]
boolean isTypeRegistered(
string
$type)
|
|
Returns whether or not the form element type is supported
Parameters:
process [line 1448]
void process(
mixed
$callback, [bool
$mergeFiles = true])
|
|
Performs the form data processing
Parameters:
registerElementType [line 298]
void registerElementType(
string
$typeName, string
$include, string
$className)
|
|
Registers a new element type
Parameters:
registerRule [line 317]
void registerRule(
string
$ruleName, string
$type, string
$data1, [string
$data2 = null])
|
|
Registers a new validation rule
Parameters:
removeElement [line 853]
void removeElement(
string
$elementName, [boolean
$removeRules = true])
|
|
Removes an element
Parameters:
setConstants [line 422]
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 356]
void setDatasource(
object
&$datasource, [mixed
$defaultsFilter = null], [mixed
$constantsFilter = null])
|
|
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 383]
void setDefaults(
[array
$defaultValues = null], [mixed
$filter = null])
|
|
Initializes default form values
Parameters:
setElementError [line 784]
void setElementError(
string
$element, string
$message)
|
|
Set error message for a form element
Parameters:
setJsWarnings [line 1276]
void setJsWarnings(
string
$pref, string
$post)
|
|
Sets JavaScript warning messages
Parameters:
setMaxFileSize [line 458]
void setMaxFileSize(
[int
$bytes = 0])
|
|
Sets the value of MAX_FILE_SIZE hidden element
Parameters:
setRequiredNote [line 1293]
void setRequiredNote(
string
$note)
|
|
Sets required-note
Parameters:
toArray [line 1635]
Returns the form's contents in an array. The description of the array structure is in HTML_QuickForm_Renderer_Array docs
toHtml [line 1516]
string toHtml(
[string
$in_data = null])
|
|
Returns an HTML version of the form
Parameters:
updateElementAttr [line 820]
void updateElementAttr(
mixed
$elements, mixed
$attrs)
|
|
Updates Attributes for one or more elements
Parameters:
validate [line 1322]
Performs the server side validation
Documentation generated on Sat, 1 May 2004 03:40:53 +0200 by phpDocumentor 1.2.3. PEAR Logo Copyright © PHP Group 2004.
|
|