package Default

 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) : boolean

Parameters

$key

string

Returns

boolean

Set a single element attribute

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

Parameters

$key

string

$value

mixed

Returns

\Zend\Form\ElementInterface

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

\Zend\Form\ElementInterface

Set the label (if any) used for this element

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

Parameters

$label

Returns

\Zend\Form\ElementInterface

Set a list of messages to report when validation fails

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

Parameters

$messages

array\Traversable

Returns

\Zend\Form\ElementInterface

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

\Zend\Form\ElementInterface

Set a single option for an element

setOption(string $key, mixed $value) : \Zend\Form\ElementInterface
fluent This method is part of a fluent interface and will return the same instance

Parameters

$key

string

$value

mixed

Returns

\Zend\Form\ElementInterface

Set options for an element

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

Parameters

$options

array\Traversable

Returns

\Zend\Form\ElementInterface

Set the value of the element

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

Parameters

$value

mixed

Returns

\Zend\Form\ElementInterface