/** * {@inheritDoc} */ public function setOptions($options) { parent::setOptions($options); if ($options instanceof Traversable) { $options = ArrayUtils::iteratorToArray($options); } foreach ($this as $element) { if (isset($options['day_attributes'])) { $element->setDayAttributes($options['day_attributes']); } if (isset($options['month_attributes'])) { $element->setMonthAttributes($options['month_attributes']); } if (isset($options['year_attributes'])) { $element->setYearAttributes($options['year_attributes']); } if (isset($options['min_year'])) { $element->setMinYear($options['min_year']); } if (isset($options['max_year'])) { $element->setMaxYear($options['max_year']); } if (isset($options['create_empty_option'])) { $element->setShouldCreateEmptyOption($options['create_empty_option']); } if (isset($options['render_delimiters'])) { $element->setShouldRenderDelimiters($options['render_delimiters']); } } if (isset($options['locale'])) { $this->setLocale($options['locale']); } if (isset($options['start_date'])) { if (isset($options['start_date']['min_date'])) { $this->setMinStartDate($options['start_date']['min_date']); } if (isset($options['start_date']['max_date'])) { $this->setMaxStartDate($options['start_date']['max_date']); } $this->elements['startDate']->setOptions($options['start_date']); } if (isset($options['end_date'])) { if (isset($options['end_date']['min_date'])) { $this->setMinEndDate($options['end_date']['min_date']); } if (isset($options['end_date']['max_date'])) { $this->setMaxEndDate($options['end_date']['max_date']); } $this->elements['endDate']->setOptions($options['end_date']); } return $this; }
/** * {@inheritDoc} */ public function setOptions($options) { parent::setOptions($options); if ($options instanceof Traversable) { $options = ArrayUtils::iteratorToArray($options); } if (isset($options['locale'])) { $this->setLocale($options['locale']); } if (isset($options['max'])) { $this->setMax($options['max']); } if (isset($options['min'])) { $this->setMin($options['min']); } if (isset($options['step'])) { $this->setStep($options['step']); } }