Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Differences Between: [Versions 39 and 400] [Versions 400 and 401] [Versions 400 and 402] [Versions 400 and 403]

Static utility methods.

File Size: 2018 lines (77 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 4 classes

HTML_QuickForm:: (2 methods):
  __construct()
  HTML_QuickForm()

name:: (53 methods):
  apiVersion()
  registerElementType()
  registerRule()
  elementExists()
  setDatasource()
  setDefaults()
  setConstants()
  setMaxFileSize()
  getMaxFileSize()
  createElement()
  _loadElement()
  addElement()
  insertElementBefore()
  addGroup()
  getElement()
  getElementValue()
  getSubmitValue()
  _reindexFiles()
  getElementError()
  setElementError()
  getElementType()
  updateElementAttr()
  removeElement()
  addRule()
  addGroupRule()
  addFormRule()
  applyFilter()
  _recursiveFilter()
  arrayMerge()
  isTypeRegistered()
  getRegisteredTypes()
  isRuleRegistered()
  getRegisteredRules()
  isElementRequired()
  isElementFrozen()
  setJsWarnings()
  setRequiredNote()
  getRequiredNote()
  validate()
  freeze()
  isFrozen()
  process()
  accept()
  defaultRenderer()
  toHtml()
  getValidationScript()
  getSubmitValues()
  toArray()
  exportValue()
  exportValues()
  isSubmitted()
  isError()
  errorMessage()

HTML_QuickForm_Error:: (2 methods):
  __construct()
  HTML_QuickForm_Error()

name:: (53 methods):
  apiVersion()
  registerElementType()
  registerRule()
  elementExists()
  setDatasource()
  setDefaults()
  setConstants()
  setMaxFileSize()
  getMaxFileSize()
  createElement()
  _loadElement()
  addElement()
  insertElementBefore()
  addGroup()
  getElement()
  getElementValue()
  getSubmitValue()
  _reindexFiles()
  getElementError()
  setElementError()
  getElementType()
  updateElementAttr()
  removeElement()
  addRule()
  addGroupRule()
  addFormRule()
  applyFilter()
  _recursiveFilter()
  arrayMerge()
  isTypeRegistered()
  getRegisteredTypes()
  isRuleRegistered()
  getRegisteredRules()
  isElementRequired()
  isElementFrozen()
  setJsWarnings()
  setRequiredNote()
  getRequiredNote()
  validate()
  freeze()
  isFrozen()
  process()
  accept()
  defaultRenderer()
  toHtml()
  getValidationScript()
  getSubmitValues()
  toArray()
  exportValue()
  exportValues()
  isSubmitted()
  isError()
  errorMessage()


Class: HTML_QuickForm  - X-Ref

Create, validate and process HTML forms

__construct($formName='', $method='post', $action='', $target='', $attributes=null, $trackSubmit = false)   X-Ref
Class constructor

param: string      $formName          Form's name.
param: string      $method            (optional)Form's method defaults to 'POST'
param: string      $action            (optional)Form's action
param: string      $target            (optional)Form's target defaults to '_self'
param: mixed       $attributes        (optional)Extra attributes for <form> tag
param: bool        $trackSubmit       (optional)Whether to track if the form was submitted by adding a special hidden field

HTML_QuickForm($formName='', $method='post', $action='', $target='', $attributes=null, $trackSubmit = false)   X-Ref
Old syntax of class constructor. Deprecated in PHP7.


Class: name  - X-Ref

apiVersion()   X-Ref
Returns the current API version

return: float

registerElementType($typeName, $include, $className)   X-Ref
Registers a new element type

return: void
param: string    $typeName   Name of element type
param: string    $include    Include path for element type
param: string    $className  Element class name

registerRule($ruleName, $type, $data1, $data2 = null)   X-Ref
Registers a new validation rule

return: void
param: string    $ruleName   Name of validation rule
param: string    $type       Either: 'regex', 'function' or 'rule' for an HTML_QuickForm_Rule object
param: string    $data1      Name of function, regular expression or HTML_QuickForm_Rule classname
param: string    $data2      Object parent of above function or HTML_QuickForm_Rule file path

elementExists($element=null)   X-Ref
Returns true if element is in the form

return: boolean
param: string   $element         form name of element to check

setDatasource(&$datasource, $defaultsFilter = null, $constantsFilter = null)   X-Ref
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.

return: void
param: object   $datasource          datasource object implementing the informal datasource protocol
param: mixed    $defaultsFilter      string or array of filter(s) to apply to default values
param: mixed    $constantsFilter     string or array of filter(s) to apply to constants values

setDefaults($defaultValues = null, $filter = null)   X-Ref
Initializes default form values

return: void
param: array    $defaultValues       values used to fill the form
param: mixed    $filter              (optional) filter(s) to apply to all default values

setConstants($constantValues = null, $filter = null)   X-Ref
Initializes constant form values.
These values won't get overridden by POST or GET vars

return: void
param: array   $constantValues        values used to fill the form
param: mixed    $filter              (optional) filter(s) to apply to all default values

setMaxFileSize($bytes = 0)   X-Ref
Sets the value of MAX_FILE_SIZE hidden element

return: void
param: int    $bytes    Size in bytes

getMaxFileSize()   X-Ref
Returns the value of MAX_FILE_SIZE hidden element

return: int   max file size in bytes

createElement($elementType)   X-Ref
Creates a new form element of the given type.

This method accepts variable number of parameters, their
meaning and count depending on $elementType

return: object extended class of HTML_element
param: string     $elementType    type of element to add (text, textarea, file...)

_loadElement($event, $type, $args)   X-Ref
Returns a form element of the given type

return: object    a new element
param: string   $event   event to send to newly created element ('createElement' or 'addElement')
param: string   $type    element type
param: array    $args    arguments for event

addElement($element)   X-Ref
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

return: object     reference to element
param: mixed      $element        element object or type of element to add (text, textarea, file...)

insertElementBefore(&$element, $nameAfter)   X-Ref
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');

return: object  HTML_QuickForm_element  reference to inserted element
param: object  HTML_QuickForm_element  Element to insert
param: string  Name of the element before which the new one is inserted

addGroup($elements, $name=null, $groupLabel='', $separator=null, $appendName = true)   X-Ref
Adds an element group

return: object     reference to added group of elements
param: array      $elements       array of elements composing the group
param: string     $name           (optional)group name
param: string     $groupLabel     (optional)group label
param: string     $separator      (optional)string to separate elements
param: string     $appendName     (optional)specify whether the group name should be

getElement($element)   X-Ref
Returns a reference to the element

return: object     reference to element
param: string     $element    Element name

getElementValue($element)   X-Ref
Returns the element's raw value

This returns the value as submitted by the form (not filtered)
or set via setDefaults() or setConstants()

return: mixed     element value
param: string     $element    Element name

getSubmitValue($elementName)   X-Ref
Returns the elements value after submit and filter

return: mixed     submitted element value or null if not set
param: string     Element name

_reindexFiles($value, $key)   X-Ref
A helper function to change the indexes in $_FILES array

return: array
param: mixed   Some value from the $_FILES array
param: string  The key from the $_FILES array that should be appended

getElementError($element)   X-Ref
Returns error corresponding to validated element

return: string    error message corresponding to checked element
param: string    $element        Name of form element to check

setElementError($element, $message = null)   X-Ref
Set error message for a form element

return: void
param: string    $element    Name of form element to set error for
param: string    $message    Error message, if empty then removes the current error message

getElementType($element)   X-Ref
Returns the type of the given element

return: string    Type of the element, false if the element is not found
param: string    $element    Name of form element

updateElementAttr($elements, $attrs)   X-Ref
Updates Attributes for one or more elements

return: void
param: mixed    $elements   Array of element names/objects or string of elements to be updated
param: mixed    $attrs      Array or sting of html attributes

removeElement($elementName, $removeRules = true)   X-Ref
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.

return: object HTML_QuickForm_element    a reference to the removed element
param: string    $elementName The element name
param: boolean   $removeRules True if rules for this element are to be removed too

addRule($element, $message, $type, $format=null, $validation='server', $reset = false, $force = false)   X-Ref
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.

param: string     $element       Form element name
param: string     $message       Message to display for invalid data
param: string     $type          Rule type, use getRegisteredRules() to get types
param: string     $format        (optional)Required for extra rule data
param: string     $validation    (optional)Where to perform validation: "server", "client"
param: boolean    $reset         Client-side validation: reset the form element to its original value if there is an error?
param: boolean    $force         Force the rule to be applied, even if the target form element does not exist

addGroupRule($group, $arg1, $type='', $format=null, $howmany=0, $validation = 'server', $reset = false)   X-Ref
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.

param: string     $group         Form group name
param: mixed      $arg1          Array for multiple elements or error message string for one element
param: string     $type          (optional)Rule type use getRegisteredRules() to get types
param: string     $format        (optional)Required for extra rule data
param: int        $howmany       (optional)How many valid elements should be in the group
param: string     $validation    (optional)Where to perform validation: "server", "client"
param: bool       $reset         Client-side: whether to reset the element's value to its original state if validation failed.

addFormRule($rule)   X-Ref
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.

param: mixed   Callback, either function name or array(&$object, 'method')

applyFilter($element, $filter)   X-Ref
Applies a data filter for the given field(s)

param: mixed     $element       Form element name or array of such names
param: mixed     $filter        Callback, either function name or array(&$object, 'method')

_recursiveFilter($filter, $value)   X-Ref
Recursively apply a filter function

return: cleaned values
param: string   $filter    filter to apply
param: mixed    $value     submitted values

arrayMerge($a, $b)   X-Ref
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.

return: array   merged array
param: array   $a  original array
param: array   $b  array which will be merged into first one

isTypeRegistered($type)   X-Ref
Returns whether or not the form element type is supported

return: boolean
param: string   $type     Form element type

getRegisteredTypes()   X-Ref
Returns an array of registered element types

return: array

isRuleRegistered($name, $autoRegister = false)   X-Ref
Returns whether or not the given rule is supported

return: mixed    true if previously registered, false if not, new rule name if auto-registering worked
param: string   $name    Validation rule name
param: bool     Whether to automatically register subclasses of HTML_QuickForm_Rule

getRegisteredRules()   X-Ref
Returns an array of registered validation rules

return: array

isElementRequired($element)   X-Ref
Returns whether or not the form element is required

return: boolean
param: string   $element     Form element name

isElementFrozen($element)   X-Ref
Returns whether or not the form element is frozen

return: boolean
param: string   $element     Form element name

setJsWarnings($pref, $post)   X-Ref
Sets JavaScript warning messages

return: void
param: string   $pref        Prefix warning
param: string   $post        Postfix warning

setRequiredNote($note)   X-Ref
Sets required-note

return: void
param: string   $note        Message indicating some elements are required

getRequiredNote()   X-Ref
Returns the required note

return: string

validate()   X-Ref
Performs the server side validation

return: boolean   true if no error found

freeze($elementList=null)   X-Ref
Displays elements without HTML input tags

param: mixed   $elementList       array or string of element(s) to be frozen

isFrozen()   X-Ref
Returns whether or not the whole form is frozen

return: boolean

process($callback, $mergeFiles = true)   X-Ref
Performs the form data processing

param: mixed     $callback        Callback, either function name or array(&$object, 'method')
param: bool      $mergeFiles      Whether uploaded files should be processed too

accept(&$renderer)   X-Ref
Accepts a renderer

return: void
param: object     An HTML_QuickForm_Renderer object

defaultRenderer()   X-Ref
Returns a reference to default renderer object

return: object a default renderer object

toHtml($in_data = null)   X-Ref
Returns an HTML version of the form

return: string     Html version of the form
param: string $in_data (optional) Any extra data to insert right

getValidationScript()   X-Ref
Returns the client side validation script

return: string    Javascript to perform validation, empty string if no 'client' rules were added

getSubmitValues($mergeFiles = false)   X-Ref
Returns the values submitted by the form

return: array
param: bool      Whether uploaded files should be returned too

toArray($collectHidden = false)   X-Ref
Returns the form's contents in an array.

The description of the array structure is in HTML_QuickForm_Renderer_Array docs

return: array of form contents
param: bool      Whether to collect hidden elements (passed to the Renderer's constructor)

exportValue($element)   X-Ref
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.

return: mixed
param: string   Name of an element

exportValues($elementList = null)   X-Ref
Returns 'safe' elements' values

Unlike getSubmitValues(), this will return only the values
corresponding to the elements present in the form.

return: array   An assoc array of elements' values
param: mixed   Array/string of element names, whose values we want. If not set then return all elements.

isSubmitted()   X-Ref
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.

return: bool

isError($value)   X-Ref
Tell whether a result from a QuickForm method is an error (an instance of HTML_QuickForm_Error)

return: bool     whether $value is an error
param: mixed     result code

errorMessage($value)   X-Ref
Return a textual error message for an QuickForm error code

return: string  error message
param: int     error code

Class: HTML_QuickForm_Error  - X-Ref

__construct($code = QUICKFORM_ERROR, $mode = PEAR_ERROR_RETURN,$level = E_USER_NOTICE, $debuginfo = null)   X-Ref
Creates a quickform error object, extending the PEAR_Error class

param: int   $code the error code
param: int   $mode the reaction to the error, either return, die or trigger/callback
param: int   $level intensity of the error (PHP error code)
param: mixed $debuginfo any information that can inform user as to nature of the error

HTML_QuickForm_Error($code = QUICKFORM_ERROR, $mode = PEAR_ERROR_RETURN,$level = E_USER_NOTICE, $debuginfo = null)   X-Ref
Old syntax of class constructor. Deprecated in PHP7.


Class: name  - X-Ref

apiVersion()   X-Ref
Returns the current API version

return: float

registerElementType($typeName, $include, $className)   X-Ref
Registers a new element type

return: void
param: string    $typeName   Name of element type
param: string    $include    Include path for element type
param: string    $className  Element class name

registerRule($ruleName, $type, $data1, $data2 = null)   X-Ref
Registers a new validation rule

return: void
param: string    $ruleName   Name of validation rule
param: string    $type       Either: 'regex', 'function' or 'rule' for an HTML_QuickForm_Rule object
param: string    $data1      Name of function, regular expression or HTML_QuickForm_Rule classname
param: string    $data2      Object parent of above function or HTML_QuickForm_Rule file path

elementExists($element=null)   X-Ref
Returns true if element is in the form

return: boolean
param: string   $element         form name of element to check

setDatasource(&$datasource, $defaultsFilter = null, $constantsFilter = null)   X-Ref
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.

return: void
param: object   $datasource          datasource object implementing the informal datasource protocol
param: mixed    $defaultsFilter      string or array of filter(s) to apply to default values
param: mixed    $constantsFilter     string or array of filter(s) to apply to constants values

setDefaults($defaultValues = null, $filter = null)   X-Ref
Initializes default form values

return: void
param: array    $defaultValues       values used to fill the form
param: mixed    $filter              (optional) filter(s) to apply to all default values

setConstants($constantValues = null, $filter = null)   X-Ref
Initializes constant form values.
These values won't get overridden by POST or GET vars

return: void
param: array   $constantValues        values used to fill the form
param: mixed    $filter              (optional) filter(s) to apply to all default values

setMaxFileSize($bytes = 0)   X-Ref
Sets the value of MAX_FILE_SIZE hidden element

return: void
param: int    $bytes    Size in bytes

getMaxFileSize()   X-Ref
Returns the value of MAX_FILE_SIZE hidden element

return: int   max file size in bytes

createElement($elementType)   X-Ref
Creates a new form element of the given type.

This method accepts variable number of parameters, their
meaning and count depending on $elementType

return: object extended class of HTML_element
param: string     $elementType    type of element to add (text, textarea, file...)

_loadElement($event, $type, $args)   X-Ref
Returns a form element of the given type

return: object    a new element
param: string   $event   event to send to newly created element ('createElement' or 'addElement')
param: string   $type    element type
param: array    $args    arguments for event

addElement($element)   X-Ref
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

return: object     reference to element
param: mixed      $element        element object or type of element to add (text, textarea, file...)

insertElementBefore(&$element, $nameAfter)   X-Ref
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');

return: object  HTML_QuickForm_element  reference to inserted element
param: object  HTML_QuickForm_element  Element to insert
param: string  Name of the element before which the new one is inserted

addGroup($elements, $name=null, $groupLabel='', $separator=null, $appendName = true)   X-Ref
Adds an element group

return: object     reference to added group of elements
param: array      $elements       array of elements composing the group
param: string     $name           (optional)group name
param: string     $groupLabel     (optional)group label
param: string     $separator      (optional)string to separate elements
param: string     $appendName     (optional)specify whether the group name should be

getElement($element)   X-Ref
Returns a reference to the element

return: object     reference to element
param: string     $element    Element name

getElementValue($element)   X-Ref
Returns the element's raw value

This returns the value as submitted by the form (not filtered)
or set via setDefaults() or setConstants()

return: mixed     element value
param: string     $element    Element name

getSubmitValue($elementName)   X-Ref
Returns the elements value after submit and filter

return: mixed     submitted element value or null if not set
param: string     Element name

_reindexFiles($value, $key)   X-Ref
A helper function to change the indexes in $_FILES array

return: array
param: mixed   Some value from the $_FILES array
param: string  The key from the $_FILES array that should be appended

getElementError($element)   X-Ref
Returns error corresponding to validated element

return: string    error message corresponding to checked element
param: string    $element        Name of form element to check

setElementError($element, $message = null)   X-Ref
Set error message for a form element

return: void
param: string    $element    Name of form element to set error for
param: string    $message    Error message, if empty then removes the current error message

getElementType($element)   X-Ref
Returns the type of the given element

return: string    Type of the element, false if the element is not found
param: string    $element    Name of form element

updateElementAttr($elements, $attrs)   X-Ref
Updates Attributes for one or more elements

return: void
param: mixed    $elements   Array of element names/objects or string of elements to be updated
param: mixed    $attrs      Array or sting of html attributes

removeElement($elementName, $removeRules = true)   X-Ref
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.

return: object HTML_QuickForm_element    a reference to the removed element
param: string    $elementName The element name
param: boolean   $removeRules True if rules for this element are to be removed too

addRule($element, $message, $type, $format=null, $validation='server', $reset = false, $force = false)   X-Ref
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.

param: string     $element       Form element name
param: string     $message       Message to display for invalid data
param: string     $type          Rule type, use getRegisteredRules() to get types
param: string     $format        (optional)Required for extra rule data
param: string     $validation    (optional)Where to perform validation: "server", "client"
param: boolean    $reset         Client-side validation: reset the form element to its original value if there is an error?
param: boolean    $force         Force the rule to be applied, even if the target form element does not exist

addGroupRule($group, $arg1, $type='', $format=null, $howmany=0, $validation = 'server', $reset = false)   X-Ref
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.

param: string     $group         Form group name
param: mixed      $arg1          Array for multiple elements or error message string for one element
param: string     $type          (optional)Rule type use getRegisteredRules() to get types
param: string     $format        (optional)Required for extra rule data
param: int        $howmany       (optional)How many valid elements should be in the group
param: string     $validation    (optional)Where to perform validation: "server", "client"
param: bool       $reset         Client-side: whether to reset the element's value to its original state if validation failed.

addFormRule($rule)   X-Ref
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.

param: mixed   Callback, either function name or array(&$object, 'method')

applyFilter($element, $filter)   X-Ref
Applies a data filter for the given field(s)

param: mixed     $element       Form element name or array of such names
param: mixed     $filter        Callback, either function name or array(&$object, 'method')

_recursiveFilter($filter, $value)   X-Ref
Recursively apply a filter function

return: cleaned values
param: string   $filter    filter to apply
param: mixed    $value     submitted values

arrayMerge($a, $b)   X-Ref
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.

return: array   merged array
param: array   $a  original array
param: array   $b  array which will be merged into first one

isTypeRegistered($type)   X-Ref
Returns whether or not the form element type is supported

return: boolean
param: string   $type     Form element type

getRegisteredTypes()   X-Ref
Returns an array of registered element types

return: array

isRuleRegistered($name, $autoRegister = false)   X-Ref
Returns whether or not the given rule is supported

return: mixed    true if previously registered, false if not, new rule name if auto-registering worked
param: string   $name    Validation rule name
param: bool     Whether to automatically register subclasses of HTML_QuickForm_Rule

getRegisteredRules()   X-Ref
Returns an array of registered validation rules

return: array

isElementRequired($element)   X-Ref
Returns whether or not the form element is required

return: boolean
param: string   $element     Form element name

isElementFrozen($element)   X-Ref
Returns whether or not the form element is frozen

return: boolean
param: string   $element     Form element name

setJsWarnings($pref, $post)   X-Ref
Sets JavaScript warning messages

return: void
param: string   $pref        Prefix warning
param: string   $post        Postfix warning

setRequiredNote($note)   X-Ref
Sets required-note

return: void
param: string   $note        Message indicating some elements are required

getRequiredNote()   X-Ref
Returns the required note

return: string

validate()   X-Ref
Performs the server side validation

return: boolean   true if no error found

freeze($elementList=null)   X-Ref
Displays elements without HTML input tags

param: mixed   $elementList       array or string of element(s) to be frozen

isFrozen()   X-Ref
Returns whether or not the whole form is frozen

return: boolean

process($callback, $mergeFiles = true)   X-Ref
Performs the form data processing

param: mixed     $callback        Callback, either function name or array(&$object, 'method')
param: bool      $mergeFiles      Whether uploaded files should be processed too

accept(&$renderer)   X-Ref
Accepts a renderer

return: void
param: object     An HTML_QuickForm_Renderer object

defaultRenderer()   X-Ref
Returns a reference to default renderer object

return: object a default renderer object

toHtml($in_data = null)   X-Ref
Returns an HTML version of the form

return: string     Html version of the form
param: string $in_data (optional) Any extra data to insert right

getValidationScript()   X-Ref
Returns the client side validation script

return: string    Javascript to perform validation, empty string if no 'client' rules were added

getSubmitValues($mergeFiles = false)   X-Ref
Returns the values submitted by the form

return: array
param: bool      Whether uploaded files should be returned too

toArray($collectHidden = false)   X-Ref
Returns the form's contents in an array.

The description of the array structure is in HTML_QuickForm_Renderer_Array docs

return: array of form contents
param: bool      Whether to collect hidden elements (passed to the Renderer's constructor)

exportValue($element)   X-Ref
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.

return: mixed
param: string   Name of an element

exportValues($elementList = null)   X-Ref
Returns 'safe' elements' values

Unlike getSubmitValues(), this will return only the values
corresponding to the elements present in the form.

return: array   An assoc array of elements' values
param: mixed   Array/string of element names, whose values we want. If not set then return all elements.

isSubmitted()   X-Ref
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.

return: bool

isError($value)   X-Ref
Tell whether a result from a QuickForm method is an error (an instance of HTML_QuickForm_Error)

return: bool     whether $value is an error
param: mixed     result code

errorMessage($value)   X-Ref
Return a textual error message for an QuickForm error code

return: string  error message
param: int     error code