appendChild [line 184]
Appends an element to the prototype container
Elements are kept in the prototype rather than directly in repeat
Overrides
HTML_QuickForm2_Container::appendChild() (Appends an element to the container)
Parameters:
appendIndexTemplates [line 374]
void appendIndexTemplates(
)
|
|
Appends the template to elements' names and ids that will be later replaced by index
Default behaviour is to append '[:idx:]' to element names and '_:idx:' to element ids. If the string ':idx:' is already present in the attribute, then it will not be changed.
Checkboxes and radios may contain ':idx:' in their 'value' attribute, in this case their 'name' attribute is left alone. Names of groups are also not touched.
backupChildAttributes [line 404]
array backupChildAttributes(
[bool
$backupId = false], [bool
$backupError = false])
|
|
Backs up child attributes
Parameters:
getChildValues [line 508]
array|null getChildValues(
[bool
$filtered = false])
|
|
Returns the array containing child elements' values
Iterates over all available repeat indexes to get values
Overrides
HTML_QuickForm2_Container::getChildValues() (Returns the array containing child elements' values)
Parameters:
getDataSources [line 228]
getIndexes [line 298]
Returns the indexes for repeated items
getPrototype [line 164]
Returns the prototype Container
getType [line 105]
__construct (Constructor) [line 132]
HTML_QuickForm2_Container_Repeat __construct(
[string
$name = null], [string|array
$attributes = null], [array
$data = array()])
|
|
Class constructor
Repeat element can understand the following keys in $data parameter:
Overrides
HTML_QuickForm2_Node::__construct() (Class constructor)
Parameters:
insertBefore [line 215]
Inserts an element to the prototype container
Elements are kept in the prototype rather than directly in repeat
Overrides
HTML_QuickForm2_Container::insertBefore() (Inserts an element in the container)
Parameters:
removeChild [line 199]
Removes the element from the prototype container
Elements are kept in the prototype rather than directly in repeat
Overrides
HTML_QuickForm2_Container::removeChild() (Removes the element from this container)
Parameters:
render [line 621]
Renders the container using the given renderer
Container will be output N + 1 times, where N are visible items and 1 is the hidden prototype used by Javascript code to create new items.
Overrides
HTML_QuickForm2_Container::render() (Renders the container using the given renderer)
Parameters:
renderClientRules [line 592]
Adds element's client-side validation rules to a builder object
This will also call forceValidator() if the repeat does not contain any (visible) items but some of the child elements define client-side rules
Overrides
HTML_QuickForm2_Node::renderClientRules() (Adds element's client-side validation rules to a builder object)
Parameters:
replaceIndexTemplates [line 473]
void replaceIndexTemplates(
int
$index, array
$backup)
|
|
Replaces a template in elements' attributes by a numeric index
Parameters:
restoreChildAttributes [line 438]
void restoreChildAttributes(
array
$backup)
|
|
Restores child attributes from backup array
Parameters:
setIndexes [line 316]
$this setIndexes(
array
$indexes)
|
|
Sets the indexes for repeated items
As is the case with elements' values, the indexes will be updated from data sources, so use this after all possible updates were done.
Parameters:
setIndexField [line 249]
$this setIndexField(
string
$field)
|
|
Sets a field to check for available indexes
Form data sources will be searched for this field's value, indexes present in the array will be used for repeated elements. Use the field that will be always present in submit data: checkboxes, multiple selects and fields that may be disabled are bad choices
Parameters:
setPrototype [line 148]
Sets the Container that will be used as a prototype for repeating
Parameters:
setValue [line 117]
updateValue [line 337]
Called when the element needs to update its value from form's data sources
Behaves similar to Element::updateValue(), the field's value is used to deduce indexes taken by repeat items.
Overrides
HTML_QuickForm2_Container::updateValue() (Called when the element needs to update its value from form's data sources)
validate [line 530]
Performs the server-side validation
Iterates over all available repeat indexes and calls validate() on prototype container.
Overrides
HTML_QuickForm2_Container::validate() (Performs the server-side validation)