Methods

__construct()

__construct(null | int | string $name, array $options) 
Inherited

inherited_from \Zend\Form\Element::__construct()

Parameters

$name

nullintstring

Optional name for the element

$options

array

Optional options for the element

Exceptions

\Zend\Form\Exception\InvalidArgumentException

Clear all attributes

clearAttributes() : \Zend\Form\Element | \Zend\Form\ElementInterface
Inherited

inherited_from \Zend\Form\Element::clearAttributes()

Returns

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

Retrieve the DateTime format to use for the value

getFormat() : string

Returns

string

Provide default input rules for this element

getInputSpecification() : array

Attaches default validators for the datetime input.

Returns

array

Retrieve the label used for this element

getLabel() : string
Inherited

inherited_from \Zend\Form\Element::getLabel()

Returns

string

Get the attributes to use with the label

getLabelAttributes() : array
Inherited

inherited_from \Zend\Form\Element::getLabelAttributes()

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(bool $returnFormattedValue) : mixed

If the value is a DateTime object, and $returnFormattedValue is true (the default), we return the string representation using the currently registered format.

If $returnFormattedValue is false, the original value will be returned, regardless of type.

Parameters

$returnFormattedValue

bool

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

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

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

\Zend\Form\Exception\InvalidArgumentException

Returns

Set value for format

setFormat(string $format) : \Zend\Form\Element\DateTime

Parameters

$format

string

Returns

Set the label used for this element

setLabel($label) : \Zend\Form\Element | \Zend\Form\ElementInterface
Inherited

inherited_from \Zend\Form\Element::setLabel()

Parameters

$label

Returns

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 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

\Zend\Form\Exception\InvalidArgumentException

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

Accepted options for DateTime: - format: A \DateTime compatible string

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

Accepted options are: - label: label to associate with the element - label_attributes: attributes to use when the label is rendered

Parameters

$options

array\Traversable

Exceptions

\Zend\Form\Exception\InvalidArgumentException

Returns

Set the element value

setValue(mixed $value) : \Zend\Form\Element
Inherited

inherited_from \Zend\Form\Element::setValue()

Parameters

$value

mixed

Returns

Retrieves a Date Validator configured for a DateTime Input type

getDateValidator() : \Zend\Form\Element\DateTime

Retrieves a DateStep Validator configured for a DateTime Input type

getStepValidator() : \Zend\Form\Element\DateTime

Get validators

getValidators() : array

Returns

array

 Properties

 

Seed attributes

$attributes : array

 

Opera and mobile browsers support datetime input, and display a datepicker control But the submitted value does not include seconds.

$format : string

 

$label

$label : string
Inherited

inherited_from \Zend\Form\Element::$$label
 

$labelAttributes

$labelAttributes : array
Inherited

inherited_from \Zend\Form\Element::$$labelAttributes
 

<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
 

$validators

$validators : array

 

$value

$value : mixed
Inherited

inherited_from \Zend\Form\Element::$$value

 Constants

 

DATETIME_FORMAT

DATETIME_FORMAT