elements, according to the * specified locale * * @var bool */ protected $renderDelimiters = true; /** @var null|ValidatorInterface */ protected $validator; /** * Constructor. Add two selects elements * * @param null|int|string $name Optional name for the element * @param iterable $options Optional options for the element */ public function __construct($name = null, iterable $options = []) { $this->minYear = ((int) date('Y')) - 100; $this->maxYear = (int) date('Y'); $this->monthElement = new Select('month'); $this->yearElement = new Select('year'); parent::__construct($name, $options); } /** * Set element options. * * 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 * * @return $this */ public function setOptions(iterable $options) { parent::setOptions($options); if (isset($this->options['month_attributes'])) { $this->setMonthAttributes($this->options['month_attributes']); } if (isset($this->options['year_attributes'])) { $this->setYearAttributes($this->options['year_attributes']); } if (isset($this->options['min_year'])) { $this->setMinYear($this->options['min_year']); } if (isset($this->options['max_year'])) { $this->setMaxYear($this->options['max_year']); } if (isset($this->options['create_empty_option'])) { $this->setShouldCreateEmptyOption($this->options['create_empty_option']); } if (isset($this->options['render_delimiters'])) { $this->setShouldRenderDelimiters($this->options['render_delimiters']); } return $this; } public function getMonthElement(): Select { return $this->monthElement; } public function getYearElement(): Select { return $this->yearElement; } /** * Get both the year and month elements * * @return list