Accepted options for Collection: - target_element: an array or element used in the collection - count: number of times the element is added initially - allow_add: if set to true, elements can be added to the form dynamically (using JavaScript) - allow_remove: if set to true, elements can be removed to the form - should_create_template: if set to true, a template is generated (inside a <span>) - template_placeholder: placeholder used in the data template
Parameters: | array|Traversable – |
---|---|
Return type: | Collection |
Checks if the object can be set in this fieldset
Parameters: | object – |
---|---|
Return type: | bool |
Set the object used by the hydrator In this case the “object” is a collection of objects
Parameters: | array|Traversable – |
---|---|
Return type: | Fieldset|FieldsetInterface |
Throws : | ExceptionInvalidArgumentException |
Populate values
Parameters: | array|Traversable – |
---|---|
Throws ZendFormExceptionInvalidArgumentException: | |
Throws ZendFormExceptionDomainException: | |
Return type: | void |
Checks if this fieldset can bind data
Return type: | bool |
---|
Bind values to the object
Parameters: | array – |
---|---|
Return type: | array|mixed|void |
Set the initial count of target element
Parameters: | $count – |
---|---|
Return type: | Collection |
Set the target element
Parameters: | ElementInterface|array|Traversable – |
---|---|
Return type: | Collection |
Throws : | ZendFormExceptionInvalidArgumentException |
Get target element
Return type: | ElementInterface|null |
---|
If set to true, a template prototype is automatically added to the form to ease the creation of dynamic elements through JavaScript
Parameters: | bool – |
---|---|
Return type: | Collection |
Get if the collection should create a template
Return type: | bool |
---|
Set the placeholder used in the template generated to help create new elements in JavaScript
Parameters: | string – |
---|---|
Return type: | Collection |
Get the template placeholder
Return type: | string |
---|
Get a template element used for rendering purposes only
Return type: | null|ElementInterface|FieldsetInterface |
---|
Prepare the collection by adding a dummy template element if the user want one
Parameters: | FormInterface – |
---|---|
Return type: | mixed|void |
@return array
If both count and targetElement are set, add them to the fieldset
Return type: | void |
---|