Howto address specific element from subform and have it displayed correctly with []
related to this question Zend_Form - Array based elements? $form = new Zend_Form(); $subForm = new Zend_Form_SubForm(); $subForm->addElement('Text', '1') ->addElement('Text', '2'); $form->addSubForm($subForm, 'element'); $var = '1'; $var2 = '2'; echo $form->getSubForm('element')->$var; echo $form->getSubForm('element')->$var2; If I use this way output will wrongly be (or at least not quite expected) <input type="text" value="" id="1" name="1"> If I use echo $form output will correctly be <input type="text" value="" id="element-1" name="element[1]"> but I loose flexibility then I am not saying