レンダリングしたい:
<input type="text" value="" name="foo[]" />
<input type="text" value="" name="bar[]" />
しかし、Zend_Form_Element には (文字列) 名が必要なので、次のようにする必要があります。
$this->addElement('text', '1', array(
'belongsTo' => 'foo'
));
$this->addElement('text', '2', array(
'belongsTo' => 'bar'
));
しかし、出力は次のとおりです。
<input id="foo-1" type="text" value="" name="foo[1]" />
<input id="bar-2" type="text" value="" name="bar[2]" />
次のような出力も受け入れることができます。
<input id="foo-1" type="text" value="" name="foo[1]" />
<input id="bar-1" type="text" value="" name="bar[1]" />
しかし Zend_Form_Element は同じ名前の要素を書き換えます
私が必要なことをする方法はありますか?