Methods

Clone the element (this is needed by Collection element, as it needs different copies of the elements)

__clone() 

Constructor.

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

Add two selects elements

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

Clear all label options

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

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

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

Should return an array specification compatible with {@link Zend\InputFilter\Factory::createInput()}.

getInputSpecification() : array

Returns

array

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

getMaxYear()

getMaxYear() : int

Returns

int

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

getMinYear()

getMinYear() : int

Returns

int

Get the month attributes

getMonthAttributes() : array

Returns

array

getMonthElement()

getMonthElement() : \Zend\Form\Element\Select

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() : String

Returns

String

Get the year attributes

getYearAttributes() : array

Returns

array

getYearElement()

getYearElement() : \Zend\Form\Element\Select

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

Prepare the form element (mostly used for rendering purposes)

prepareElement(\Zend\Form\FormInterface $form) : mixed

Parameters

Returns

mixed

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

\Zend\Form\Exception\InvalidArgumentException

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

\Zend\Form\Exception\InvalidArgumentException

Returns

setMaxYear()

setMaxYear(int $maxYear) : \Zend\Form\Element\MonthSelect

Parameters

$maxYear

int

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

setMinYear()

setMinYear(int $minYear) : \Zend\Form\Element\MonthSelect

Parameters

$minYear

int

Returns

Set the month attributes

setMonthAttributes(array $monthAttributes) : \Zend\Form\Element\MonthSelect

Parameters

$monthAttributes

array

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

Accepted options for DateSelect: - month_attributes: HTML attributes to be rendered with the month element - year_attributes: HTML attributes to be rendered with the month element - min_year: min year to use in the year select - max_year: max year to use in the year select

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

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

Parameters

$options

array\Traversable

Exceptions

\Zend\Form\Exception\InvalidArgumentException

Returns

setShouldCreateEmptyOption()

setShouldCreateEmptyOption(bool $createEmptyOption) : \Zend\Form\Element\MonthSelect

Parameters

$createEmptyOption

bool

Returns

setShouldRenderDelimiters()

setShouldRenderDelimiters(bool $renderDelimiters) : \Zend\Form\Element\MonthSelect

Parameters

$renderDelimiters

bool

Returns

Set the element value

setValue(mixed $value) : void | \Zend\Form\Element

Parameters

$value

mixed

Returns

Set the year attributes

setYearAttributes(array $yearAttributes) : \Zend\Form\Element\MonthSelect

Parameters

$yearAttributes

array

Returns

shouldCreateEmptyOption()

shouldCreateEmptyOption() : bool

Returns

bool

shouldRenderDelimiters()

shouldRenderDelimiters() : bool

Returns

bool

 Properties

 

$attributes

$attributes : array
Inherited

inherited_from \Zend\Form\Element::$$attributes
 

If set to true, it will generate an empty option for every select (this is mainly needed by most JavaScript libraries to allow to have a placeholder)

$createEmptyOption : bool

 

$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
 

Max year to use for the select (default: current year)

$maxYear : int

 

<p>Validation error messages</p>

$messages : array
Inherited

inherited_from \Zend\Form\Element::$$messages
 

Min year to use for the select (default: current year - 100)

$minYear : int

 

Select form element that contains values for month

$monthElement : \Zend\Form\Element\Select

 

<p>custom options</p>

$options : array
Inherited

inherited_from \Zend\Form\Element::$$options
 

If set to true, view helpers will render delimiters between <select> elements, according to the specified locale

$renderDelimiters : bool

 

$validator

$validator : \Zend\Validator\ValidatorInterface

 

$value

$value : mixed
Inherited

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

Select form element that contains values for year

$yearElement : \Zend\Form\Element\Select