Interface ElementInterface

Summary

Fully Qualified Name: Zend\Form\ElementInterface

Description

Methods

Name Description Defined By
getAttribute() Retrieve a single element attribute ElementInterface
getAttributes() Retrieve all attributes at once ElementInterface
getLabel() Retrieve the label (if any) used for this element ElementInterface
getMessages() Get validation error messages, if any ElementInterface
getName() Retrieve the element name ElementInterface
getOption() return the specified option ElementInterface
getOptions() get the defined options ElementInterface
getValue() Retrieve the element value ElementInterface
hasAttribute() Return true if a specific attribute is set ElementInterface
setAttribute() Set a single element attribute ElementInterface
setAttributes() Set many attributes at once ElementInterface
setLabel() Set the label (if any) used for this element ElementInterface
setMessages() Set a list of messages to report when validation fails ElementInterface
setName() Set the name of this element ElementInterface
setOption() Set a single option for an element ElementInterface
setOptions() Set options for an element ElementInterface
setValue() Set the value of the element ElementInterface

Method Details

getAttribute()

Retrieve a single element attribute

Parameter Name Type Description
$key string

Returns: mixed

getAttributes()

Retrieve all attributes at once

Returns: array|\Traversable

getLabel()

Retrieve the label (if any) used for this element

Returns: string

getMessages()

Get validation error messages, if any

Returns a list of validation failure messages, if any.

Returns: array|\Traversable

getName()

Retrieve the element name

Returns: string

getOption()

return the specified option

Parameter Name Type Description
$option string

Returns: null|mixed

getOptions()

get the defined options

Returns: array

getValue()

Retrieve the element value

Returns: mixed

hasAttribute()

Return true if a specific attribute is set

Parameter Name Type Description
$key string

Returns: bool

setAttribute()

Set a single element attribute

Parameter Name Type Description
$key string
$value mixed

Returns: \ElementInterface

setAttributes()

Set many attributes at once

Implementation will decide if this will overwrite or merge.

Parameter Name Type Description
$arrayOrTraversable array|\Traversable

Returns: \ElementInterface

setLabel()

Set the label (if any) used for this element

Parameter Name Type Description
$label
$label

Returns: \ElementInterface

setMessages()

Set a list of messages to report when validation fails

Parameter Name Type Description
$messages array|\Traversable

Returns: \ElementInterface

setName()

Set the name of this element

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

Parameter Name Type Description
$name string

Returns: \ElementInterface

setOption()

Set a single option for an element

Parameter Name Type Description
$key string
$value mixed

Returns: self

setOptions()

Set options for an element

Parameter Name Type Description
$options array|\Traversable

Returns: \ElementInterface

setValue()

Set the value of the element

Parameter Name Type Description
$value mixed

Returns: \ElementInterface

Top