Methods

Retrieve a single element attribute

getAttribute(string $key) : mixed

Parameters

$key

string

Returns

mixed

Retrieve all attributes at once

getAttributes() : array | \Traversable

Returns

array\Traversable

Retrieve the label (if any) used for this element

getLabel() : string

Returns

string

Get validation error messages, if any

getMessages() : array | \Traversable

Returns a list of validation failure messages, if any.

Returns

array\Traversable

Retrieve the element name

getName() : string

Returns

string

return the specified option

getOption(string $option) : null | mixed

Parameters

$option

string

Returns

nullmixed

get the defined options

getOptions() : array

Returns

array

Retrieve the element value

getValue() : mixed

Returns

mixed

Return true if a specific attribute is set

hasAttribute(string $key) : bool

Parameters

$key

string

Returns

bool

Set a single element attribute

setAttribute(string $key, mixed $value) : \Zend\Form\ElementInterface

Parameters

$key

string

$value

mixed

Returns

Set many attributes at once

setAttributes(array | \Traversable $arrayOrTraversable) : \Zend\Form\ElementInterface

Implementation will decide if this will overwrite or merge.

Parameters

$arrayOrTraversable

array\Traversable

Returns

Set the label (if any) used for this element

setLabel($label) : \Zend\Form\ElementInterface

Parameters

$label

Returns

Set a list of messages to report when validation fails

setMessages(array | \Traversable $messages) : \Zend\Form\ElementInterface

Parameters

$messages

array\Traversable

Returns

Set the name of this element

setName(string $name) : \Zend\Form\ElementInterface

In most cases, this will proxy to the attributes for storage, but is present to indicate that elements are generally named.

Parameters

$name

string

Returns

Set options for an element

setOptions(array | \Traversable $options) : \Zend\Form\ElementInterface

Parameters

$options

array\Traversable

Returns

Set the value of the element

setValue(mixed $value) : \Zend\Form\ElementInterface

Parameters

$value

mixed

Returns