__construct (Constructor) [line 224]
HTML_QuickForm2_Container_Repeat __construct(
[string
$name = null], [string|array
$attributes = null], [
$data = array()])
|
|
Class constructor
Repeat element can understand the following keys in $data parameter:
Overrides
HTML_QuickForm2_Node::__construct() (Class constructor)
Parameters:
appendChild [line 276]
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 466]
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 496]
array backupChildAttributes(
[bool
$backupId = false], [bool
$backupError = false])
|
|
Backs up child attributes
Parameters:
getChildValues [line 597]
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 320]
getIndexes [line 390]
Returns the indexes for repeated items
getPrototype [line 256]
Returns the prototype Container
getType [line 197]
insertBefore [line 307]
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 291]
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 678]
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:
replaceIndexTemplates [line 562]
void replaceIndexTemplates(
int
$index,
$backup)
|
|
Replaces a template in elements' attributes by a numeric index
Parameters:
restoreChildAttributes [line 527]
void restoreChildAttributes(
$backup)
|
|
Restores child attributes from backup array
Parameters:
setIndexes [line 408]
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 341]
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 240]
Sets the Container that will be used as a prototype for repeating
Parameters:
setValue [line 209]
updateValue [line 429]
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 619]
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)