2

我想在生日菜单助手中添加“月”、“日”、“年”作为首选?这可以做到吗?我没有看到任何有关如何执行此操作的示例?下面是我的代码:

    <?php echo $this->Form->input('date_of_birth', 
        array(
            'type' => 'date',
            'label' => 'Date of Birth:<span>*</span>',
            'dateFormat' => 'MDY',
            'empty' => true,
            'minYear' => date('Y')-130,
            'maxYear' => date('Y'),
            'options' => array('1','2')
            )
        );
    ?>

谢谢,巴特

4

1 回答 1

4

在这里,empty选项接受一个数组month,您可以在其中使用键、yeardayhour和指定各个字段的空minutemeridian

echo $this->Form->input('date_of_birth', 
    array(
        'type' => 'date',
        'label' => 'Date of Birth:<span>*</span>',
        'dateFormat' => 'MDY',
        'empty' => array(
            'month' => 'Month',
            'day'   => 'Day',
            'year'  => 'Year'
        ),
        'minYear' => date('Y')-130,
        'maxYear' => date('Y'),
        'options' => array('1','2')
    )
);
于 2013-07-01T15:45:28.057 回答