Methods
__construct ($namespace)
Constructor
clearAllTemplates ()
Clears all the HTML out of the templates that surround notes, elements, etc.
Useful when you want to use addData() to create a completely custom form look
finishGroup (\HTML_QuickForm_group $group)
Called when visiting a group, after processing all group elements
Parameters
$group
\HTML_QuickForm_group
&$group The object being visited
renderElement (\HTML_QuickForm_element $element, boolean $required, string $error)
Renders an element as HTML
Parameters
$element
\HTML_QuickForm_element
&$element The object being visited
$required
boolean
Whether an element is required
$error
string
An error message associated with an element
renderHidden (\HTML_QuickForm_hidden $element)
Renders a hidden element
Parameters
$element
\HTML_QuickForm_hidden
&$element The object being visited
renderHtml (\HTML_QuickForm_html $data)
Called when visiting a raw HTML/text pseudo-element
Parameters
$data
\HTML_QuickForm_html
&$data The element being visited
setElementTemplate (string $html, string $element)
Sets element template
Parameters
$html
string
The HTML surrounding an element
$element
string
The (optional) name of the element to apply template for
setGroupElementTemplate (string $html, string $group)
Sets element template for elements within a group
Parameters
$html
string
The HTML surrounding an element
$group
string
The name of the group to apply template for
setGroupTemplate (string $html, string $group)
Sets template for a group wrapper
This template is contained within a group-as-element template
set via setTemplate() and contains group's element templates, set
via setGroupElementTemplate()
Parameters
$html
string
The HTML surrounding group elements
$group
string
The name of the group to apply template for
setRequiredNoteTemplate (string $html)
Sets the note indicating required fields template
Parameters
$html
string
The HTML surrounding the required note
startGroup (\HTML_QuickForm_group $group, boolean $required, string $error)
Called when visiting a group, before processing any group elements
Parameters
$group
\HTML_QuickForm_group
&$group The object being visited
$required
boolean
Whether a group is required
$error
string
An error message associated with a group
toHtml ()
returns the HTML generated for the form
_prepare_template (string $name, \HTML_Quickform_element $element, boolean $required, string $error, string $type)
Helper method for renderElement
Parameters
$name
string
Element name
$element
\HTML_Quickform_element
The element we're working on
$required
boolean
Whether an element is required
$error
string
Error message associated with the element
$type
string
Element type
Returns
string
HTML for the element
_process_placeholder ($html, $identifier, $value)
Parameters
$html
$identifier
$value
_set_group_templates (string $name)
Called by start/finishGroup() to set the current template elements
Parameters
$name
string
The group to set the templates to.
Properties
string $_current_group_name
The current group running
array $_current_group_templates
All group templates for running groups (i.e.
array $_current_groups
The stack of groups
string $_default_group_template
Group template string
string $_element_template
Element template string
string $_group_element_template
Template for an element inside a group
array $_group_element_templates
Array containing the templates for elements in groups.
array $_group_elements
Array with HTML generated for group elements
string $_group_wrap
HTML that wraps around the group elements
array $_group_wraps
Array containing the templates for group wraps.
These templates are wrapped around group elements and the group's own
templates wrap around them. This is set by setGroupTemplate().
string $_hidden_html
Collected HTML of the hidden fields
string $_html
The HTML of the form
boolean $_in_group
True if we are inside a group
string $_required_note_template
Required Note template string
array $_templates
Array containing the templates for customised elements