2013-04-28 50 views

回答

2

下面CakePHP的代碼將生成具有給定的默認值和數據後同樣下拉框中將相同:

echo $this->Form->day('Profile.dob', array('empty'=>'Day','class' => 'cls-day')); 
echo $this->Form->month('Profile.dob', array('empty'=>'Month','class' => 'cls-month')); 
echo $this->Form->year('Profile.dob', 1950, date('Y'),array('empty'=>'Year','class' => 'cls-year'));