对于 cakephp 1.3,我为生日创建了一个下拉菜单,如下所示
echo $form->input('User.birthday',
array(
'label' => __("form_birthday", "true") ,
'class' => 'date',
'selected' => 'empty',
'dateFormat' => 'DMY',
'minYear' => date('Y') - 90,
'maxYear' => date('Y') - 18,
'separator'=> " ",
'empty' => __("form_select", true),
)
);
产生
<div class="input date"><label for="UserBirthdayMonth">Month & Year of Birth</label><select id="UserBirthdayDay" class="date" name="birthday">
<option value="">- Select -</option>
.....
</select> <select id="UserBirthdayMonth" class="date" name="birthday">
<option value="">- Select -</option>
<option value="01">January</option>
<option value="02">February</option>
<option value="03">March</option>
<option value="04">April</option>
<option value="05">May</option>
<option value="06">June</option>
<option value="07">July</option>
<option value="08">August</option>
<option value="09">September</option>
<option value="10">October</option>
<option value="11">November</option>
<option value="12">December</option>
</select> <select id="UserBirthdayYear" class="date" name="birthday">
<option value="">- Select -</option>
.....
</select></div>
请注意下拉列表的名称属性都是“生日”。如何在 cake 中更改它,以使上面三个下拉列表的名称属性不完全相同?我希望它们类似于“birthday_month”、“birthday_year”和“birthday_day”。