Methods
Make a deep clone of a fieldset
__clone() : void
__construct()
__construct(null | int | string $name, array $options)
Parameters
$name
nullintstringOptional name for the element
$options
arrayOptional options for the element
Exceptions
Add an element or fieldset
add(array | \Traversable | \Zend\Form\ElementInterface $elementOrFieldset, array $flags) : \Zend\Form\Fieldset | \Zend\Form\FieldsetInterface
$flags could contain metadata such as the alias under which to register
the element or fieldset, order in which to prioritize it, etc.
| todo |
Should we detect if the element/fieldset name conflicts? |
Parameters
$flags
array
Exceptions
Returns
Checks if the object can be set in this fieldset
allowObjectBinding(object $object) : bool
Parameters
$object
object
Returns
bool
Checks if this fieldset can bind data
allowValueBinding() : bool
Bind values to the bound object
bindValues(array $values) : mixed | void
Parameters
$values
array
Returns
mixedvoid
Countable: return count of attached elements/fieldsets
count() : int
Retrieve a named element or fieldset
get(string $elementOrFieldset) : \Zend\Form\ElementInterface
| todo |
Should this raise an exception if no entry is found? |
Parameters
$elementOrFieldset
string
Returns
Retrieve a single element attribute
getAttribute($key) : mixed | null
Inherited
| inherited_from |
\Zend\Form\Element::getAttribute() |
Parameters
$key
Returns
mixednull
Retrieve all attributes at once
getAttributes() : array | \Traversable
Inherited
| inherited_from |
\Zend\Form\Element::getAttributes() |
Returns
array\Traversable
Retrieve all attached elements
getElements() : array | \Traversable
Storage is an implementation detail of the concrete class.
Returns
array\Traversable
Retrieve all attached fieldsets
getFieldsets() : array | \Traversable
Storage is an implementation detail of the concrete class.
Returns
array\Traversable
Retrieve the label used for this element
getLabel() : string
Inherited
| inherited_from |
\Zend\Form\Element::getLabel() |
Returns
string
Get the attributes to use with the label
getLabelAttributes() : array
Inherited
| inherited_from |
\Zend\Form\Element::getLabelAttributes() |
Returns
array
Get validation error messages, if any
getMessages(null | string $elementName) : array | \Traversable
Returns a hash of element names/messages for all elements failing
validation, or, if $elementName is provided, messages for that element
only.
Parameters
$elementName
nullstring
Exceptions
Returns
array\Traversable
Get value for name
getName() : string | int
Inherited
| inherited_from |
\Zend\Form\Element::getName() |
Returns
stringint
Get the object used by the hydrator
getObject() : mixed
Return the specified option
getOption(string $option) : NULL | mixed
Inherited
| inherited_from |
\Zend\Form\Element::getOption() |
Parameters
$option
string
Returns
NULLmixed
Get defined options
getOptions() : array
Inherited
| inherited_from |
\Zend\Form\Element::getOptions() |
Returns
array
Retrieve the element value
getValue() : mixed
Inherited
| inherited_from |
\Zend\Form\Element::getValue() |
Returns
mixed
Does the fieldset have an element/fieldset by the given name?
has(string $elementOrFieldset) : bool
Parameters
$elementOrFieldset
string
Returns
bool
Does the element has a specific attribute ?
hasAttribute(string $key) : bool
Inherited
| inherited_from |
\Zend\Form\Element::hasAttribute() |
Parameters
$key
string
Returns
bool
This function is automatically called when creating element with factory.
init() : void
Inherited
It
allows to perform various operations (add elements...)
| inherited_from |
\Zend\Form\Element::init() |
Recursively populate values of attached elements and fieldsets
populateValues(array | \Traversable $data) : void
Parameters
$data
array\Traversable
Exceptions
Ensures state is ready for use.
prepareElement(\Zend\Form\FormInterface $form) : mixed | void
Here, we append the name of the fieldsets to every elements in order to avoid
name clashes if the same fieldset is used multiple times
Parameters
Returns
mixedvoid
Remove a named element or fieldset
remove(string $elementOrFieldset) : \Zend\Form\FieldsetInterface
Parameters
$elementOrFieldset
string
Returns
Remove a single attribute
removeAttribute(string $key) : \Zend\Form\ElementInterface
Inherited
| inherited_from |
\Zend\Form\Element::removeAttribute() |
Parameters
$key
string
Returns
Remove many attributes at once
removeAttributes(array $keys) : \Zend\Form\ElementInterface
Inherited
| inherited_from |
\Zend\Form\Element::removeAttributes() |
Parameters
$keys
array
Returns
Set a single element attribute
setAttribute(string $key, mixed $value) : \Zend\Form\Element | \Zend\Form\ElementInterface
Inherited
| inherited_from |
\Zend\Form\Element::setAttribute() |
Parameters
$key
string
$value
mixed
Returns
Set many attributes at once
setAttributes(array | \Traversable $arrayOrTraversable) : \Zend\Form\Element | \Zend\Form\ElementInterface
Inherited
Implementation will decide if this will overwrite or merge.
| inherited_from |
\Zend\Form\Element::setAttributes() |
Parameters
$arrayOrTraversable
array\Traversable
Exceptions
Returns
Set the hydrator to use when binding an object to the element
setHydrator(\Zend\Stdlib\Hydrator\HydratorInterface $hydrator) : \Zend\Form\FieldsetInterface
Set the attributes to use with the label
setLabelAttributes(array $labelAttributes) : \Zend\Form\Element | \Zend\Form\ElementInterface
Inherited
| inherited_from |
\Zend\Form\Element::setLabelAttributes() |
Parameters
$labelAttributes
array
Returns
Set value for name
setName(string $name) : \Zend\Form\Element | \Zend\Form\ElementInterface
Inherited
In most cases, this will proxy to the attributes for storage, but is
present to indicate that elements are generally named.
| inherited_from |
\Zend\Form\Element::setName() |
Parameters
$name
string
Returns
Set options for a fieldset.
setOptions(array | \Traversable $options) : \Zend\Form\Element | \Zend\Form\ElementInterface
Accepted options are:
- use_as_base_fieldset: is this fieldset use as the base fieldset?
Parameters
$options
array\Traversable
Exceptions
Returns
Set/change the priority of an element or fieldset
setPriority(string $elementOrFieldset, int $priority) : \Zend\Form\FieldsetInterface
Parameters
$elementOrFieldset
string
$priority
int
Returns
Set if this fieldset is used as a base fieldset
setUseAsBaseFieldset(bool $useAsBaseFieldset) : \Zend\Form\Fieldset
Parameters
$useAsBaseFieldset
bool
Returns
Set the element value
setValue(mixed $value) : \Zend\Form\Element
Inherited
| inherited_from |
\Zend\Form\Element::setValue() |
Parameters
$value
mixed
Returns
Is this fieldset use as a base fieldset for a form ?
useAsBaseFieldset() : bool
Properties
$attributes
$attributes : array
Inherited
| inherited_from |
\Zend\Form\Element::$$attributes |
$elements
$elements : array
$fieldsets
$fieldsets : array
$label
$label : string
Inherited
| inherited_from |
\Zend\Form\Element::$$label |
$labelAttributes
$labelAttributes : array
Inherited
| inherited_from |
\Zend\Form\Element::$$labelAttributes |
$messages
$messages : array
The object bound to this fieldset, if any
$object : null | object
<p>custom options</p>
$options : array
Inherited
| inherited_from |
\Zend\Form\Element::$$options |
Should this fieldset be used as a base fieldset in the parent form ?
$useAsBaseFieldset : bool
$value
$value : mixed
Inherited
| inherited_from |
\Zend\Form\Element::$$value |