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
Retrieve a single element attribute
getAttribute($key) : mixed | null
Inherited
inherited_from |
\Zend\Form\Element::getAttribute() |
Parameters
$key
Returns
mixed
null
Retrieve all attributes at once
getAttributes() : array | \Traversable
Inherited
inherited_from |
\Zend\Form\Element::getAttributes() |
Returns
array
\Traversable
Get both the year and month elements
getElements() : array
Retrieve the label used for this element
getLabel() : null | string
Inherited
inherited_from |
\Zend\Form\Element::getLabel() |
Returns
null
string
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
mixed
null
Get label specific options
getLabelOptions() : array
Inherited
inherited_from |
\Zend\Form\Element::getLabelOptions() |
Returns
array
getMaxYear()
getMaxYear() : 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
Get the month attributes
getMonthAttributes() : array
Get value for name
getName() : string | int
Inherited
inherited_from |
\Zend\Form\Element::getName() |
Returns
string
int
Return the specified option
getOption(string $option) : NULL | mixed
Inherited
inherited_from |
\Zend\Form\Element::getOption() |
Parameters
$option
string
Returns
NULL
mixed
Get defined options
getOptions() : array
Inherited
inherited_from |
\Zend\Form\Element::getOptions() |
Returns
array
Retrieve the element value
getValue() : string
Get the year attributes
getYearAttributes() : array
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) : void
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
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
setMaxYear()
setMaxYear(int $maxYear) : \Zend\Form\Element\self
Parameters
$maxYear
int
Returns
\Zend\Form\Element\self
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
setMinYear()
setMinYear(int $minYear) : \Zend\Form\Element\self
Parameters
$minYear
int
Returns
\Zend\Form\Element\self
Set the month attributes
setMonthAttributes(array $monthAttributes) : \Zend\Form\Element\self
Parameters
$monthAttributes
array
Returns
\Zend\Form\Element\self
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 element options.
setOptions(array | \Traversable $options) : \Zend\Form\Element\self
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
Parameters
$options
array\Traversable
Exceptions
Returns
\Zend\Form\Element\self
setShouldCreateEmptyOption()
setShouldCreateEmptyOption(bool $createEmptyOption) : \Zend\Form\Element\self
Parameters
$createEmptyOption
bool
Returns
\Zend\Form\Element\self
setShouldRenderDelimiters()
setShouldRenderDelimiters(bool $renderDelimiters) : \Zend\Form\Element\self
Parameters
$renderDelimiters
bool
Returns
\Zend\Form\Element\self
Set the element value
setValue(mixed $value) : \Zend\Form\Element\self
Parameters
$value
mixed
Returns
\Zend\Form\Element\self
Set the year attributes
setYearAttributes(array $yearAttributes) : \Zend\Form\Element\self
Parameters
$yearAttributes
array
Returns
\Zend\Form\Element\self
shouldCreateEmptyOption()
shouldCreateEmptyOption() : bool
shouldRenderDelimiters()
shouldRenderDelimiters() : 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
<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
$value
$value : mixed
Inherited
inherited_from |
\Zend\Form\Element::$$value |