Multidimensional Array based Elements
Using Zend_Form, how would I create form ele开发者_运维问答ments like this
<input type="text" name="element[1]" value=""/>
<input type="text" name="element[2]" value=""/>
Use a SubForm:
$form = new Zend_Form;
$subForm = new Zend_Form_SubForm('SubForm', 'element');
$subForm->addElements(array(
$subForm->createElement('Text', '0'),
$subForm->createElement('Text', '1'),
));
$form->addSubForm($subForm, 'element');
I'm sure this can be written with array notation somehow too.
精彩评论