Methods
__construct()
__construct(null | int | string $name, array $options)
Inherited
| inherited_from |
\Zend\Form\Element::__construct() |
Parameters
$name
nullintstringOptional name for the element
$options
arrayOptional options for the element
Exceptions
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
Get the email validator to use for multiple or single
email addresses.
getEmailValidator() : \Zend\Validator\ValidatorInterface
Note from the HTML5 Specs regarding the regex:
"This requirement is a willful violation of RFC 5322, which
defines a syntax for e-mail addresses that is simultaneously
too strict (before the "@" character), too vague
(after the "@" character), and too lax (allowing comments,
whitespace characters, and quoted strings in manners
unfamiliar to most users) to be of practical use here."
The default Regex validator is in use to match that of the
browser validation, but you are free to set a different
(more strict) email validator such as Zend\Validator\Email
if you wish.
Returns
Retrieve the label used for this element
getLabel() : null | string
Inherited
| inherited_from |
\Zend\Form\Element::getLabel() |
Returns
nullstring
Get the attributes to use with the label
getLabelAttributes() : array
Inherited
| inherited_from |
\Zend\Form\Element::getLabelAttributes() |
Returns
array
Retrieve a single label option
getLabelOption($key) : mixed | null
Inherited
| inherited_from |
\Zend\Form\Element::getLabelOption() |
Parameters
$key
Returns
mixednull
Get label specific options
getLabelOptions() : array
Inherited
| inherited_from |
\Zend\Form\Element::getLabelOptions() |
Returns
array
Get validation error messages, if any.
getMessages() : array | \Traversable
Inherited
Returns a list of validation failure messages, if any.
| inherited_from |
\Zend\Form\Element::getMessages() |
Returns
array\Traversable
Get value for name
getName() : string | int
Inherited
| inherited_from |
\Zend\Form\Element::getName() |
Returns
stringint
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 element has a specific attribute ?
hasAttribute(string $key) : bool
Inherited
| inherited_from |
\Zend\Form\Element::hasAttribute() |
Parameters
$key
string
Returns
bool
Does the element has a specific label option ?
hasLabelOption(string $key) : bool
Inherited
| inherited_from |
\Zend\Form\Element::hasLabelOption() |
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() |
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
Remove a single label option
removeLabelOption(string $key) : \Zend\Form\ElementInterface
Inherited
| inherited_from |
\Zend\Form\Element::removeLabelOption() |
Parameters
$key
string
Returns
Remove many attributes at once
removeLabelOptions(array $keys) : \Zend\Form\ElementInterface
Inherited
| inherited_from |
\Zend\Form\Element::removeLabelOptions() |
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
Sets the email validator to use for multiple or single
email addresses.
setEmailValidator(\Zend\Validator\ValidatorInterface $validator) : \Zend\Form\Element\Email
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 a single label optionn
setLabelOption(string $key, mixed $value) : \Zend\Form\Element | \Zend\Form\ElementInterface
Inherited
| inherited_from |
\Zend\Form\Element::setLabelOption() |
Parameters
$key
string
$value
mixed
Returns
Set many label options at once
setLabelOptions(array | \Traversable $arrayOrTraversable) : \Zend\Form\Element | \Zend\Form\ElementInterface
Inherited
Implementation will decide if this will overwrite or merge.
| inherited_from |
\Zend\Form\Element::setLabelOptions() |
Parameters
$arrayOrTraversable
array\Traversable
Exceptions
Returns
Set a list of messages to report when validation fails
setMessages(array | \Traversable $messages) : \Zend\Form\Element | \Zend\Form\ElementInterface
Inherited
| inherited_from |
\Zend\Form\Element::setMessages() |
Parameters
$messages
array\Traversable
Exceptions
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 a single option for an element
setOption(string $key, mixed $value) : \Zend\Form\self
Inherited
| inherited_from |
\Zend\Form\Element::setOption() |
Parameters
$key
string
$value
mixed
Returns
\Zend\Form\self
Set options for an element.
setOptions(array | \Traversable $options) : \Zend\Form\Element | \Zend\Form\ElementInterface
Inherited
Accepted options are:
- label: label to associate with the element
- label_attributes: attributes to use when the label is rendered
- label_options: label specific options
| inherited_from |
\Zend\Form\Element::setOptions() |
Parameters
$options
array\Traversable
Exceptions
Returns
Sets the primary validator to use for this element
setValidator(\Zend\Validator\ValidatorInterface $validator) : \Zend\Form\Element\Email
Set the element value
setValue(mixed $value) : \Zend\Form\Element
Inherited
| inherited_from |
\Zend\Form\Element::setValue() |
Parameters
$value
mixed
Returns
Properties
Seed attributes
$attributes : array
$label
$label : null | string
Inherited
| inherited_from |
\Zend\Form\Element::$$label |
$labelAttributes
$labelAttributes : array
Inherited
| inherited_from |
\Zend\Form\Element::$$labelAttributes |
Label specific options
$labelOptions : array
Inherited
| inherited_from |
\Zend\Form\Element::$$labelOptions |
<p>Validation error messages</p>
$messages : array
Inherited
| inherited_from |
\Zend\Form\Element::$$messages |
<p>custom options</p>
$options : array
Inherited
| inherited_from |
\Zend\Form\Element::$$options |
$value
$value : mixed
Inherited
| inherited_from |
\Zend\Form\Element::$$value |