ZF-5613: Allow subforms to be initialized at Zend_Form instantiation with config
Description
It would be a great and simple additional feature to allow subforms to be part of the Zend_Form instantiation using a config. Currently, they are "forbidden" in the Zend_Form file. I would imagine a simple loop adding new Zend_Form_SubForm would do it. Currently, I do use configs like the following, but I have a simple loop through it to add the subforms to my form in my controller.
$form_config = array(
'attribs' => array(
'name' => 'form_name'
),
'subForms' => array(
'subform1' => array(
'elements' => array(
'test1' => array('Text', array(
'label' => 'Test1'
))
),
'order' => 2
),
'subform2' => array(
'elements' => array(
'test2' => array('Text', array(
'label' => 'Test2'
))
),
'order' => 1
)
)
);
Comments
Posted by Sven Weingartner (wissenstausch) on 2010-07-14T05:11:32.000+0000
We have defined the forms as XML:
... ... addressFor this we override the addSubForms() method:
Posted by Frank Brückner (frosch) on 2012-07-27T14:00:37.000+0000
Patch and unit tests. (includes a extra unit test for XHTML output)
Posted by Frank Brückner (frosch) on 2013-01-08T08:57:15.000+0000
Fixed on trunk (25192) and release-1.12 (25193)