Zend Form and nested fieldsets/containers?

2019-09-02 18:53发布

I have a form. I have a single element that needs to be wrapped in a div or fieldset (for formatting). Then I have two groups of elements, including the above, that I want to wrap in a fieldset or div. I've managed to create two groups, but Zend Form seems to balk at letting me create a group containing a group. Should I be able to do this?

Here's a simple code example, assuming I have created elem1, elem2 and elem3.

$form->addDisplayGroup(array('elem1'), 'group1', array("legend" => "Wrapped element"));
$form->addDisplayGroup(array('group1', 'elem2', 'elem3'), 'group2', array("legend" => "All elements"));

1条回答
老娘就宠你
2楼-- · 2019-09-02 19:31

Nasted groups - nope :( but you can use subforms.

查看更多
登录 后发表回答