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
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
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() : mixed
Inherited
inherited_from |
\Zend\Form\Element::getValue() |
Returns
mixed
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
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
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
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
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 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
Parameters
$options
array\Traversable
Exceptions
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
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 : string
Inherited
inherited_from |
\Zend\Form\Element::$$label |
$labelAttributes
$labelAttributes : array
Inherited
inherited_from |
\Zend\Form\Element::$$labelAttributes |
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 |