Cakephp表单输入字段costum title抛出错误:

Cakephp表单输入字段costum title抛出错误:,php,cakephp,Php,Cakephp,这相当简单,但根据文档,我可以执行以下操作: echo $this->Form->input('name', 'Produkt'); echo $this->Form->input('antal', array('title'=>'På lager')); 其中,“Produkt将是输入字段的标题 但是,当我尝试此操作时,会出现以下错误: Warning (2): array_merge(): Argument #3 is not an array [C

这相当简单,但根据文档,我可以执行以下操作:

    echo $this->Form->input('name', 'Produkt');
echo $this->Form->input('antal', array('title'=>'På lager'));
其中,
“Produkt
将是输入字段的标题

但是,当我尝试此操作时,会出现以下错误:

Warning (2): array_merge(): Argument #3 is not an array [CORE\Cake\View\Helper\FormHelper.php, line 1078]

Notice (8): Unenter code heredefined index: before [CORE\Cake\View\Helper\FormHelper.php, line 992]

Notice (8): Undefined index: between [CORE\Cake\View\Helper\FormHelper.php, line 992]

Notice (8): Undefined index: after [CORE\Cake\View\Helper\FormHelper.php, line 992]

Notice (8): Undefined index: format [CORE\Cake\View\Helper\FormHelper.php, line 1200]
我做错了什么

注:我还尝试了以下方法:

    echo $this->Form->input('name', 'Produkt');
echo $this->Form->input('antal', array('title'=>'På lager'));
$options=array()
输入的
为:

public function input($fieldName, $options = array()) {
在方法需要数组的位置传递字符串将不起作用。如果有一些文档表明这应该有效-请指出它和/或提交一个补丁来纠正它

要设置输入的标题,只需将其指定为选项的一部分:

echo $this->Form->input('name', array('label' => 'Produkt'));
关于这一补充点:

注意,我也尝试了以下方法


将数组作为第二个参数传递,因为相关变量将是数组。如果有不同的错误消息,请指出它是什么。

这会删除错误,但不会将标题从name更改为Produkt。这是因为
title
不是要使用的正确数组键-请参阅文档或文档块=)