$years = range(2009, 2020);
$month = range ???;
$days = range ???;
$w = new sfWidgetFormDate(
array('years' => array_combine($years, $years),
'month' => array_combine($month, $month),
'days' => array_combine($days, $days),
)
);
我怎样才能在这个例子中做过0天到过去,40到未来有实际日期?
答案 0 :(得分:0)
<?php
$years = array_unique(array(date('Y'), date('Y', strtotime('+40 days'))));
$months = array_unique(array(date('m'), date('m', strtotime('first day of next month')), date('m', strtotime('+40 days'))));
$days = range(date('d'), 31);
答案 1 :(得分:0)
format('Y'); $yr_init = $yr_actual-10; $years = range($yr_actual,$yr_init);
$this->widgetSchema['bcg_1'] = new sfWidgetFormDate(array('format' =>
'%day%/%month%/%year%','years'=>array_combine($years, $years))); ?>