Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/258.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php ZF-数组形式的嵌套子窗体_Php_Zend Framework - Fatal编程技术网

Php ZF-数组形式的嵌套子窗体

Php ZF-数组形式的嵌套子窗体,php,zend-framework,Php,Zend Framework,我正在创建一个网站,其中有一系列子表单要显示。我一直在摆弄Zend_Form::setIsArray(真的),但除了我不能真正理解它的确切功能外,我觉得这不是我想要的 这或多或少是我的想法 <form> <form id="Paragraph[0]"> <input name="Paragraph[0]['text']" type="text"> <input name="Paragraph[0]['heading']" type="

我正在创建一个网站,其中有一系列子表单要显示。我一直在摆弄Zend_Form::setIsArray(真的),但除了我不能真正理解它的确切功能外,我觉得这不是我想要的

这或多或少是我的想法

<form>
  <form id="Paragraph[0]">
    <input name="Paragraph[0]['text']" type="text">
    <input name="Paragraph[0]['heading']" type="text">
  </form>
  <form id="Paragraph[1]">
    <input name="Paragraph[1]['text']" type="text">
    <input name="Paragraph[1]['heading']" type="text">
  </form>
</form>


编辑:我最好使用
s而不是嵌套表单。是这样吗?

对于子窗体,您可以执行以下操作:

<form>
  <form id="Paragraph0">
    <input name="Paragraph0[text]" type="text">
    <input name="Paragraph0[heading]" type="text">
  </form>
  <form id="Paragraph1">
    <input name="Paragraph1[text]" type="text">
    <input name="Paragraph1[heading]" type="text">
  </form>
</form>

看看这里的文件:

我不明白你的问题。是否要为单个窗体合并子窗体?但表单应该有提交按钮。我认为不能在另一个表单中添加表单。问题毕竟不在ZF。我似乎不能嵌套超过3个表单,所以我删除了所有嵌套子表单的“表单”装饰器,它给了我想要的效果。谢谢(希望这能帮助其他人)
$_POST = array(
  'Paragraph0' => array('text' => ..., 'heading' => ...),
  'Paragraph1' => array('text' => ..., 'heading' => ...)
)