Zend 表单输入名称同名 [英] Zend form input name with same name
问题描述
使用 Zend 1.9 我正在尝试使用 Zend Form 模块生成表单.我的表格应该是这样的:
Using Zend 1.9 I am trying to generate a form using Zend Form module . My form should be like this:
<form method="post" action="myaction">
<input type="text" name="editors[]" />
<input type="text" name="editors[]" />
<input type="text" name="editors[]" />
<input type="text" name="editors[]" />
<button type="submit" >Go</button>
</form>
当我在控制器中提交表单时,我希望看到如下内容:
When I submit the form in my controller I want to see something like this:
Zend_Debug::dump($this->getAllParams());
//I expect this output:
array (size=4)
'controller' => string 'myCotnroller' (length=8)
'module' => string 'MyModule' (length=14)
'action' => string 'test' (length=4)
'editors' =>
array (size=4)
0 => string '' (length=3)
1 => string '' (length=0)
2 => string '' (length=0)
3 => string '' (length=0)
我上周尝试了很多次都没有结果.我没有任何谷歌搜索结果.你能帮助我吗?
I the last week I tried many and many times with no result. I have search whitout any goog result . Can you help me?
推荐答案
我希望其中一些能帮助您完成任务.
Zend Framework:使用数组表示法中的表单元素
高级 Zend_Form 用法
Zend_Form - 基于数组的元素?
如何配置 Zend_Form 以使用数组表示法?
I hope some of these will help on your quest.
Zend Framework: Working with Form elements in array notation
Advanced Zend_Form Usage
Zend_Form - Array based elements?
How do configure Zend_Form to use array notation?
这篇关于Zend 表单输入名称同名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!