package Default
inherited_from \Zend\Form\Element\MonthSelect

 Methods

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

__clone() 
inherited_from \Zend\Form\Element\MonthSelect::__clone()

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

__clone() 
Inherited

Constructor. Add the day select element

__construct(null|integer|string $name = null, array $options = array()
inherited_from \Zend\Form\Element\MonthSelect::__construct()

Parameters

$name

nullintegerstring

Optional name for the element

$options

array

Optional options for the element

__construct()

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

Parameters

$name

nullintegerstring

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\ElementAttributeRemovalInterface::clearAttributes()

Returns

\Zend\Form\Element\Zend\Form\ElementInterface

Clear all label options

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

Returns

\Zend\Form\Element\Zend\Form\ElementInterface

Retrieve a single element attribute

getAttribute(string $key) : mixed | null
Inherited
inherited_from \Zend\Form\ElementInterface::getAttribute()

Parameters

$key

Returns

mixednull

Retrieve all attributes at once

getAttributes() : array | \Traversable
Inherited
inherited_from \Zend\Form\ElementInterface::getAttributes()

Returns

array\Traversable

Get the day attributes

getDayAttributes() : array

Returns

array

getDayElement()

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

Returns

\Zend\Form\Element\Select

Get both the year and month elements

getElements() : array
inherited_from \Zend\Form\Element\MonthSelect::getElements()

Returns

array

Get both the year and month elements

getElements() : array
Inherited

Returns

array

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

getInputSpecification() : array
inherited_from \Zend\Form\Element\MonthSelect::getInputSpecification()

Returns

array

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

getInputSpecification() : array
Inherited
inherited_from \Zend\InputFilter\InputProviderInterface::getInputSpecification()

Returns

array

Retrieve the label used for this element

getLabel() : null | string
Inherited
inherited_from \Zend\Form\ElementInterface::getLabel()

Returns

nullstring

Get the attributes to use with the label

getLabelAttributes() : array
Inherited
inherited_from \Zend\Form\LabelAwareInterface::getLabelAttributes()

Returns

array

Retrieve a single label option

getLabelOption($key) : mixed | null
Inherited
inherited_from \Zend\Form\LabelAwareInterface::getLabelOption()

Parameters

$key

Returns

mixednull

Get label specific options

getLabelOptions() : array
Inherited
inherited_from \Zend\Form\LabelAwareInterface::getLabelOptions()

Returns

array

getMaxYear()

getMaxYear() : integer
Inherited

Returns

integer

Get validation error messages, if any.

getMessages() : array | \Traversable
Inherited

Returns a list of validation failure messages, if any.

inherited_from \Zend\Form\ElementInterface::getMessages()

Returns

array\Traversable

getMinYear()

getMinYear() : integer
Inherited

Returns

integer

Get the month attributes

getMonthAttributes() : array
Inherited

Returns

array

getMonthElement()

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

Returns

\Zend\Form\Element\Select

Get value for name

getName() : string | integer
Inherited
inherited_from \Zend\Form\ElementInterface::getName()

Returns

stringinteger

Return the specified option

getOption(string $option) : NULL | mixed
Inherited
inherited_from \Zend\Form\ElementInterface::getOption()

Parameters

$option

string

Returns

NULLmixed

Get defined options

getOptions() : array
Inherited
inherited_from \Zend\Form\ElementInterface::getOptions()

Returns

array

Retrieve the element value

getValue() : String
inherited_from \Zend\Form\Element\MonthSelect::getValue()

Returns

String

Retrieve the element value

getValue() : mixed
Inherited
inherited_from \Zend\Form\ElementInterface::getValue()

Returns

mixed

Get the year attributes

getYearAttributes() : array
Inherited

Returns

array

getYearElement()

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

Returns

\Zend\Form\Element\Select

Does the element has a specific attribute ?

hasAttribute(string $key) : boolean
Inherited
inherited_from \Zend\Form\ElementInterface::hasAttribute()

Parameters

$key

string

Returns

boolean

Does the element has a specific label option ?

hasLabelOption(string $key) : boolean
Inherited
inherited_from \Zend\Form\LabelAwareInterface::hasLabelOption()

Parameters

$key

string

Returns

boolean

This function is automatically called when creating element with factory. It allows to perform various operations (add elements.

init() : void
Inherited

..)

inherited_from \Zend\Stdlib\InitializableInterface::init()

Prepare the form element (mostly used for rendering purposes)

prepareElement(\Zend\Form\FormInterface $form) : mixed
inherited_from \Zend\Form\Element\MonthSelect::prepareElement()

Parameters

$form

\Zend\Form\FormInterface

Returns

mixed

Prepare the form element (mostly used for rendering purposes)

prepareElement(\Zend\Form\FormInterface $form) : void
Inherited
inherited_from \Zend\Form\ElementPrepareAwareInterface::prepareElement()

Parameters

$form

\Zend\Form\FormInterface

Remove a single attribute

removeAttribute(string $key) : \Zend\Form\ElementInterface
Inherited
inherited_from \Zend\Form\ElementAttributeRemovalInterface::removeAttribute()

Parameters

$key

string

Returns

\Zend\Form\ElementInterface

Remove many attributes at once

removeAttributes(array $keys) : \Zend\Form\ElementInterface
Inherited
inherited_from \Zend\Form\ElementAttributeRemovalInterface::removeAttributes()

Parameters

$keys

array

Returns

\Zend\Form\ElementInterface

Remove a single label option

removeLabelOption(string $key) : \Zend\Form\ElementInterface
Inherited
inherited_from \Zend\Form\LabelAwareInterface::removeLabelOption()

Parameters

$key

string

Returns

\Zend\Form\ElementInterface

Remove many attributes at once

removeLabelOptions(array $keys) : \Zend\Form\ElementInterface
Inherited
inherited_from \Zend\Form\LabelAwareInterface::removeLabelOptions()

Parameters

$keys

array

Returns

\Zend\Form\ElementInterface

Set a single element attribute

setAttribute(string $key, mixed $value) : \Zend\Form\Element | \Zend\Form\ElementInterface
Inherited
inherited_from \Zend\Form\ElementInterface::setAttribute()

Parameters

$key

string

$value

mixed

Returns

\Zend\Form\Element\Zend\Form\ElementInterface

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\ElementInterface::setAttributes()

Parameters

$arrayOrTraversable

array\Traversable

Exceptions

\Zend\Form\Exception\InvalidArgumentException

Returns

\Zend\Form\Element\Zend\Form\ElementInterface

Set the day attributes

setDayAttributes(array $dayAttributes) : \Zend\Form\Element\DateSelect
fluent This method is part of a fluent interface and will return the same instance

Parameters

$dayAttributes

array

Returns

\Zend\Form\Element\DateSelect

Set the label used for this element

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

Parameters

$label

Returns

\Zend\Form\Element\Zend\Form\ElementInterface

Set the attributes to use with the label

setLabelAttributes(array $labelAttributes) : \Zend\Form\Element | \Zend\Form\ElementInterface
Inherited
inherited_from \Zend\Form\LabelAwareInterface::setLabelAttributes()

Parameters

$labelAttributes

array

Returns

\Zend\Form\Element\Zend\Form\ElementInterface

Set a single label optionn

setLabelOption(string $key, mixed $value) : \Zend\Form\Element | \Zend\Form\ElementInterface
Inherited
inherited_from \Zend\Form\LabelAwareInterface::setLabelOption()

Parameters

$key

string

$value

mixed

Returns

\Zend\Form\Element\Zend\Form\ElementInterface

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\LabelAwareInterface::setLabelOptions()

Parameters

$arrayOrTraversable

array\Traversable

Exceptions

\Zend\Form\Exception\InvalidArgumentException

Returns

\Zend\Form\Element\Zend\Form\ElementInterface

setMaxYear()

setMaxYear(integer $maxYear) : \Zend\Form\Element\DateSelect
Inherited
fluent This method is part of a fluent interface and will return the same instance

Parameters

$maxYear

integer

Returns

\Zend\Form\Element\DateSelect

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\ElementInterface::setMessages()

Parameters

$messages

array\Traversable

Exceptions

\Zend\Form\Exception\InvalidArgumentException

Returns

\Zend\Form\Element\Zend\Form\ElementInterface

setMinYear()

setMinYear(integer $minYear) : \Zend\Form\Element\DateSelect
Inherited
fluent This method is part of a fluent interface and will return the same instance

Parameters

$minYear

integer

Returns

\Zend\Form\Element\DateSelect

Set the month attributes

setMonthAttributes(array $monthAttributes) : \Zend\Form\Element\DateSelect
Inherited
fluent This method is part of a fluent interface and will return the same instance

Parameters

$monthAttributes

array

Returns

\Zend\Form\Element\DateSelect

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\ElementInterface::setName()

Parameters

$name

string

Returns

\Zend\Form\Element\Zend\Form\ElementInterface

Set a single option for an element

setOption(string $key, mixed $value) : \Zend\Form\Element\DateSelect
Inherited
inherited_from \Zend\Form\ElementInterface::setOption()
fluent This method is part of a fluent interface and will return the same instance

Parameters

$key

string

$value

mixed

Returns

\Zend\Form\Element\DateSelect

Accepted options for DateSelect (plus the ones from MonthSelect) : - day_attributes: HTML attributes to be rendered with the day element

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

Accepted options for MonthSelect:

  • 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
inherited_from \Zend\Form\Element\MonthSelect::setOptions()
fluent This method is part of a fluent interface and will return the same instance

Parameters

$options

array\Traversable

Returns

\Zend\Form\Element\DateSelect

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

setOptions(array|\Traversable $options) : \Zend\Form\Element | \Zend\Form\ElementInterface
Inherited
inherited_from \Zend\Form\ElementInterface::setOptions()

Parameters

$options

array\Traversable

Exceptions

\Zend\Form\Exception\InvalidArgumentException

Returns

\Zend\Form\Element\Zend\Form\ElementInterface

setShouldCreateEmptyOption()

setShouldCreateEmptyOption(boolean $createEmptyOption) : \Zend\Form\Element\DateSelect
Inherited
fluent This method is part of a fluent interface and will return the same instance

Parameters

$createEmptyOption

boolean

Returns

\Zend\Form\Element\DateSelect

setShouldRenderDelimiters()

setShouldRenderDelimiters(boolean $renderDelimiters) : \Zend\Form\Element\DateSelect
Inherited
fluent This method is part of a fluent interface and will return the same instance

Parameters

$renderDelimiters

boolean

Returns

\Zend\Form\Element\DateSelect

Set the element value

setValue(string|array|\ArrayAccess|\DateTime $value) : \Zend\Form\Element\DateSelect
inherited_from \Zend\Form\Element\MonthSelect::setValue()
fluent This method is part of a fluent interface and will return the same instance

Parameters

$value

stringarray\ArrayAccess\DateTime

Exceptions

\Zend\Form\Exception\InvalidArgumentException

Returns

\Zend\Form\Element\DateSelectProvides a fluent interface

Set the element value

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

Parameters

$value

mixed

Returns

\Zend\Form\Element

Set the year attributes

setYearAttributes(array $yearAttributes) : \Zend\Form\Element\DateSelect
Inherited
fluent This method is part of a fluent interface and will return the same instance

Parameters

$yearAttributes

array

Returns

\Zend\Form\Element\DateSelect

shouldCreateEmptyOption()

shouldCreateEmptyOption() : boolean
Inherited

Returns

boolean

shouldRenderDelimiters()

shouldRenderDelimiters() : boolean
Inherited

Returns

boolean

Get validator

getValidator() : \Zend\Validator\ValidatorInterface
inherited_from \Zend\Form\Element\MonthSelect::getValidator()

Returns

\Zend\Validator\ValidatorInterface

Get validator

getValidator() : \Zend\Validator\ValidatorInterface
Inherited

Returns

\Zend\Validator\ValidatorInterface

 Properties

 

$attributes

$attributes : array

Default

array()
 

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

Default

false
 

Select form element that contains values for day

$dayElement : \Zend\Form\Element\Select

Default

 

$label

$label : null | string

Default

 

$labelAttributes

$labelAttributes : array

Default

array()
 

Label specific options

$labelOptions : array

Default

array()
 

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

$maxYear : integer

Default

 

Validation error messages

$messages : array

Default

array()
 

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

$minYear : integer

Default

 

Select form element that contains values for month

$monthElement : \Zend\Form\Element\Select

Default

 

custom options

$options : array

Default

array()
 

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

$renderDelimiters : boolean

Default

true
 

$validator

$validator : \Zend\Validator\ValidatorInterface

Default

 

$value

$value : mixed

Default

 

Select form element that contains values for year

$yearElement : \Zend\Form\Element\Select

Default