Fully Qualified Name: | Zend\Form\Element\Email |
Extends: | Element |
Implements: | InputProviderInterface |
Name | Description | Defined By |
---|---|---|
__construct() | Element | |
clearAttributes() | Clear all attributes | Element |
clearLabelOptions() | Clear all label options | Element |
getAttribute() | Retrieve a single element attribute | Element |
getAttributes() | Retrieve all attributes at once | Element |
getEmailValidator() | Get the email validator to use for multiple or single email addresses. | |
getInputSpecification() | Provide default input rules for this element | |
getLabel() | Retrieve the label used for this element | Element |
getLabelAttributes() | Get the attributes to use with the label | Element |
getLabelOption() | Retrieve a single label option | Element |
getLabelOptions() | Get label specific options | Element |
getMessages() | Get validation error messages, if any. | Element |
getName() | Get value for name | Element |
getOption() | Return the specified option | Element |
getOptions() | Get defined options | Element |
getValidator() | Get primary validator | |
getValue() | Retrieve the element value | Element |
hasAttribute() | Does the element has a specific attribute ? | Element |
hasLabelOption() | Does the element has a specific label option ? | Element |
init() | This function is automatically called when creating element with factory. It allows to perform various operations (add elements. | Element |
removeAttribute() | Remove a single attribute | Element |
removeAttributes() | Remove many attributes at once | Element |
removeLabelOption() | Remove a single label option | Element |
removeLabelOptions() | Remove many attributes at once | Element |
setAttribute() | Set a single element attribute | Element |
setAttributes() | Set many attributes at once | Element |
setEmailValidator() | Sets the email validator to use for multiple or single email addresses. | |
setLabel() | Set the label used for this element | Element |
setLabelAttributes() | Set the attributes to use with the label | Element |
setLabelOption() | Set a single label optionn | Element |
setLabelOptions() | Set many label options at once | Element |
setMessages() | Set a list of messages to report when validation fails | Element |
setName() | Set value for name | Element |
setOption() | Set a single option for an element | Element |
setOptions() | Set options for an element. 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 | Element |
setValidator() | Sets the primary validator to use for this element | |
setValue() | Set the element value | Element |
Parameter Name | Type | Description |
---|---|---|
$name | null|int|string | Optional |
$options | array | Optional |
Returns:
Clear all attributes
Returns: \Element|\ElementInterface
Clear all label options
Returns: \Element|\ElementInterface
Retrieve a single element attribute
Parameter Name | Type | Description |
---|---|---|
$key | ||
$key |
Returns: mixed|null
Retrieve all attributes at once
Returns: array|\Traversable
Get the email validator to use for multiple or single email addresses.
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: \ValidatorInterface
Provide default input rules for this element
Attaches an email validator.
Returns: array
Retrieve the label used for this element
Returns: null|string
Get the attributes to use with the label
Returns: array
Retrieve a single label option
Parameter Name | Type | Description |
---|---|---|
$key | ||
$key |
Returns: mixed|null
Get label specific options
Returns: array
Get validation error messages, if any.
Returns a list of validation failure messages, if any.
Returns: array|\Traversable
Get value for name
Returns: string|int
Return the specified option
Parameter Name | Type | Description |
---|---|---|
$option | string |
Returns: null|mixed
Get defined options
Returns: array
Get primary validator
Returns: \ValidatorInterface
Retrieve the element value
Returns: mixed
Does the element has a specific attribute ?
Parameter Name | Type | Description |
---|---|---|
$key | string |
Returns: bool
Does the element has a specific label option ?
Parameter Name | Type | Description |
---|---|---|
$key | string |
Returns: bool
This function is automatically called when creating element with factory. It allows to perform various operations (add elements.
..)
Returns: void
Remove a single attribute
Parameter Name | Type | Description |
---|---|---|
$key | string |
Returns: \ElementInterface
Remove many attributes at once
Parameter Name | Type | Description |
---|---|---|
$keys | array |
Returns: \ElementInterface
Remove a single label option
Parameter Name | Type | Description |
---|---|---|
$key | string |
Returns: \ElementInterface
Remove many attributes at once
Parameter Name | Type | Description |
---|---|---|
$keys | array |
Returns: \ElementInterface
Set a single element attribute
Parameter Name | Type | Description |
---|---|---|
$key | string | |
$value | mixed |
Returns: \Element|\ElementInterface
Set many attributes at once
Implementation will decide if this will overwrite or merge.
Parameter Name | Type | Description |
---|---|---|
$arrayOrTraversable | array|\Traversable |
Returns: \Element|\ElementInterface
Sets the email validator to use for multiple or single email addresses.
Parameter Name | Type | Description |
---|---|---|
$validator | \ValidatorInterface |
Returns: \Email
Set the label used for this element
Parameter Name | Type | Description |
---|---|---|
$label | ||
$label |
Returns: \Element|\ElementInterface
Set the attributes to use with the label
Parameter Name | Type | Description |
---|---|---|
$labelAttributes | array |
Returns: \Element|\ElementInterface
Set a single label optionn
Parameter Name | Type | Description |
---|---|---|
$key | string | |
$value | mixed |
Returns: \Element|\ElementInterface
Set many label options at once
Implementation will decide if this will overwrite or merge.
Parameter Name | Type | Description |
---|---|---|
$arrayOrTraversable | array|\Traversable |
Returns: \Element|\ElementInterface
Set a list of messages to report when validation fails
Parameter Name | Type | Description |
---|---|---|
$messages | array|\Traversable |
Returns: \Element|\ElementInterface
Set value for name
Parameter Name | Type | Description |
---|---|---|
$name | string |
Returns: \Element|\ElementInterface
Set a single option for an element
Parameter Name | Type | Description |
---|---|---|
$key | string | |
$value | mixed |
Returns: self
Set options for an element. 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
Parameter Name | Type | Description |
---|---|---|
$options | array|\Traversable |
Returns: \Element|\ElementInterface
Sets the primary validator to use for this element
Parameter Name | Type | Description |
---|---|---|
$validator | \ValidatorInterface |
Returns: \Email
Set the element value
Parameter Name | Type | Description |
---|---|---|
$value | mixed |
Returns: \Element