开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜