Мы хотим такой вид:
Решение:
public function setup()
{
$years = range(1950, 2000); //Creates array of years between 1950-2000
$years_list = array_combine($years, $years); //Creates new array where key and value are both values from $years list
$this->setWidgets(array(
'id' => new sfWidgetFormInputHidden(),
'city' => new sfWidgetFormInput(),
'birthday' => new sfWidgetFormI18nDate(
array(
'culture' => 'ru',
'format' => '%day%.%month%.%year%',
'years' => $years_list,
),
array()
),
Комментариев нет:
Отправить комментарий