protected function createYearControl($container, $column, $record) { $value = $this->getRecordPropertyValue($column, $record); $control = new TDropDownList(); $years = array(); $current = intval(@date('Y')); $from = $current - 10; $to = $current + 10; for ($i = $from; $i <= $to; $i++) { $years[$i] = $i; } $control->setDataSource($years); $control->setSelectedValue(empty($value) ? $current : $value); $control->setCssClass('year-dropdown'); $this->setNotNullProperty($container, $control, $column, $record); return $control; }