我在 CakePHP 2.1.2 中使用 FormHelper。当我发布包含许多元素分组的表单时,生成的 $request->data 数组在第 143 组截断。例如:
<?php
// going through a large for() loop using iterator $iter.
echo $this->Form->hidden('field1', array('name' => "Example[$iter][field1]", 'value' => 'field1'));
echo $this->Form->hidden('field2', array('name' => "Example[$iter][field2]", 'value' => 'field2'));
echo $this->Form->hidden('field3', array('name' => "Example[$iter][field3]", 'value' => 'field3'));
echo $this->Form->text('text', array('name' => "Example[$iter][text]", 'value' => ''));
?>
debug() 结果如下所示:
array(
    (int) 0 => array(
        'field1' => 'field1',
        'field2' => 'field2',
        'field3' => 'field3',
        'text' => 'something',
    ),
    (int) 1 => array(
        'field1' => 'field1',
        'field2' => 'field2',
        'field3' => 'field3',
        'text' => 'something else',
    ),
    ....
    (int) 142 => array(
        'field1' => 'field1',
        'field2' => 'field2',
    ),
);
在 $this->request->data['Example"] 中,第 143 组已损坏。我不知道这是如何发生的。任何想法都会非常有帮助。非常感谢。