Zend\Form\Element\MonthSelect
Synopsis
class MonthSelect
extends Element
implements
InputProviderInterface,ElementPrepareAwareInterface
{
- // members
- protected Select $monthElement;
- protected Select $yearElement;
- protected int $minYear;
- protected int $maxYear;
- protected bool $createEmptyOption;
- protected bool $renderDelimiters;
- protected ValidatorInterface $validator;
- // Inherited members from Element
- protected array $attributes;
- protected null|string $label;
- protected array $labelAttributes;
- protected array $labelOptions;
- protected array $messages;
- protected array $options;
- protected mixed $value;
- // methods
- public void __construct()
- public MonthSelect setOptions()
- public Select getMonthElement()
- public Select getYearElement()
- public MonthSelect setMonthAttributes()
- public array getMonthAttributes()
- public MonthSelect setYearAttributes()
- public array getYearAttributes()
- public MonthSelect setMinYear()
- public int getMinYear()
- public MonthSelect setMaxYear()
- public int getMaxYear()
- public MonthSelect setShouldCreateEmptyOption()
- public bool shouldCreateEmptyOption()
- public MonthSelect setShouldRenderDelimiters()
- public bool shouldRenderDelimiters()
- public Element setValue()
- public String getValue()
- public mixed prepareElement()
- protected ValidatorInterface getValidator()
- public array getInputSpecification()
- public void __clone()
- // Inherited methods from Element
- public void __construct()
- public void init()
- public Element|ElementInterface setName()
- public string|int getName()
- public Element|ElementInterface setOptions()
- public array getOptions()
- public NULL|mixed getOption()
- public self setOption()
- public Element|ElementInterface setAttribute()
- public mixed|null getAttribute()
- public ElementInterface removeAttribute()
- public bool hasAttribute()
- public Element|ElementInterface setAttributes()
- public array|Traversable getAttributes()
- public ElementInterface removeAttributes()
- public Element|ElementInterface clearAttributes()
- public Element setValue()
- public mixed getValue()
- public Element|ElementInterface setLabel()
- public null|string getLabel()
- public Element|ElementInterface setLabelAttributes()
- public array getLabelAttributes()
- public Element|ElementInterface setLabelOptions()
- public array getLabelOptions()
- public Element|ElementInterface clearLabelOptions()
- public ElementInterface removeLabelOptions()
- public Element|ElementInterface setLabelOption()
- public mixed|null getLabelOption()
- public ElementInterface removeLabelOption()
- public bool hasLabelOption()
- public Element|ElementInterface setMessages()
- public array|Traversable getMessages()
Hierarchy
Extends
Extended by
Implements
Members
protected
- $attributes — array
- $createEmptyOption
—
Zend\Form\Element\bool
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) - $label — Zend\Form\null|string
- $labelAttributes — array
- $labelOptions
—
array
Label specific options - $maxYear
—
int
Max year to use for the select (default: current year) - $messages — array
- $minYear
—
int
Min year to use for the select (default: current year - 100) - $monthElement
—
Zend\Form\Element\Select
Select form element that contains values for month - $options — array
- $renderDelimiters
—
Zend\Form\Element\bool
If set to true, view helpers will render delimiters between <select> elements, according to the specified locale - $validator — Zend\Validator\ValidatorInterface
- $value — mixed
- $yearElement
—
Zend\Form\Element\Select
Select form element that contains values for year
Methods
protected
- getValidator() — Get validator
public
- __construct() — Constructor. Add two selects elements
- __clone() — Clone the element (this is needed by Collection element, as it needs different copies of the elements)
- getInputSpecification() — Should return an array specification compatible with {@link Zend\InputFilter\Factory::createInput()}.
- getMaxYear()
- getMinYear()
- getMonthAttributes() — Get the month attributes
- getMonthElement()
- getValue()
- getYearAttributes() — Get the year attributes
- getYearElement()
- prepareElement() — Prepare the form element (mostly used for rendering purposes)
- setMaxYear()
- setMinYear()
- setMonthAttributes() — Set the month attributes
- setOptions() — 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
- setShouldCreateEmptyOption()
- setShouldRenderDelimiters()
- setValue()
- setYearAttributes() — Set the year attributes
- shouldCreateEmptyOption()
- shouldRenderDelimiters()
Inherited from Zend\Form\Element
public
- clearAttributes() — Clear all attributes
- clearLabelOptions() — Clear all label options
- getAttribute() — Retrieve a single element attribute
- getAttributes() — Retrieve all attributes at once
- getLabel() — Retrieve the label used for this element
- getLabelAttributes() — Get the attributes to use with the label
- getLabelOption() — Retrieve a single label option
- getLabelOptions() — Get label specific options
- getMessages() — Get validation error messages, if any.
- getName() — Get value for name
- getOption() — Return the specified option
- getOptions() — Get defined options
- getValue() — Retrieve the element value
- hasAttribute() — Does the element has a specific attribute ?
- hasLabelOption() — Does the element has a specific label option ?
- init() — This function is automatically called when creating element with factory. It allows to perform various operations (add elements...)
- removeAttribute() — Remove a single attribute
- removeAttributes() — Remove many attributes at once
- removeLabelOption() — Remove a single label option
- removeLabelOptions() — Remove many attributes at once
- setAttribute() — Set a single element attribute
- setAttributes() — Set many attributes at once
- setLabel() — Set the label used for this element
- setLabelAttributes() — Set the attributes to use with the label
- setLabelOption() — Set a single label optionn
- setLabelOptions() — Set many label options at once
- setMessages() — Set a list of messages to report when validation fails
- setName() — Set value for name
- setOption() — Set a single option for an element
- setOptions() — 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
- setValue() — Set the element value