如何在CakePHP表单帮助器中显示--select--

sha*_*ikh -2 cakephp cakephp-1.3 cakephp-2.0

我想使用CakePHP表单助手显示--Select--作为默认值,并且默认选择此值.

当前代码:

echo $this->Form->month('m');
echo $this->Form->day('d');
echo $this->Form->year('y');
Run Code Online (Sandbox Code Playgroud)

谢谢.

dr *_*ter 5

这比谢赫的答案更正确:

echo $this->Form->month('m', array('empty' => __('-- Select --')));
Run Code Online (Sandbox Code Playgroud)

不需要javascript,将来很容易翻译.这一切都清楚地写在API参考中.