/** * {@inheritDoc} */ public function setOptions($options) { parent::setOptions($options); if ($options instanceof Traversable) { $options = ArrayUtils::iteratorToArray($options); } if (isset($options['max_date'])) { $this->setMaxDate($options['max_date']); } if (isset($options['min_date'])) { $this->setMinDate($options['min_date']); } return $this; }
/** * Accepted options for DateTimeSelect (plus the ones from DateSelect) : * - hour_attributes: HTML attributes to be rendered with the hour element * - minute_attributes: HTML attributes to be rendered with the minute element * - second_attributes: HTML attributes to be rendered with the second element * - should_show_seconds: if set to true, the seconds select is shown * * @param array|\Traversable $options * @return DateSelect */ public function setOptions($options) { parent::setOptions($options); if (isset($options['hour_attributes'])) { $this->setHourAttributes($options['hour_attributes']); } if (isset($options['minute_attributes'])) { $this->setMinuteAttributes($options['minute_attributes']); } if (isset($options['second_attributes'])) { $this->setSecondAttributes($options['second_attributes']); } if (isset($options['should_show_seconds'])) { $this->setShouldShowSeconds($options['should_show_seconds']); } return $this; }
/** * Set options for DateTimeSelect element. * * Accepted options for DateTimeSelect (plus the ones from DateSelect): * * - hour_attributes: HTML attributes to be rendered with the hour element * - minute_attributes: HTML attributes to be rendered with the minute element * - second_attributes: HTML attributes to be rendered with the second element * - should_show_seconds: if set to true, the seconds select is shown * * @param array|Traversable $options * @return self */ public function setOptions($options) { parent::setOptions($options); if ($options instanceof Traversable) { $options = ArrayUtils::iteratorToArray($options); } if (isset($options['hour_attributes'])) { $this->setHourAttributes($options['hour_attributes']); } if (isset($options['minute_attributes'])) { $this->setMinuteAttributes($options['minute_attributes']); } if (isset($options['second_attributes'])) { $this->setSecondAttributes($options['second_attributes']); } if (isset($options['should_show_seconds'])) { $this->setShouldShowSeconds($options['should_show_seconds']); } return $this; }