【发布时间】:2023-03-09 03:32:02
【问题描述】:
我用 Zend\Form\Element\Collection 创建了一个输入集合,比如
$this->add([
'type' => 'Zend\Form\Element\Collection',
'name' => 'some-name',
'options' => [
'label' => 'some name',
'count' => 3,
'target_element' => [
'type' => 'text',
],
],
]);
如果我使用,此代码会呈现 3 个带有标签和字段集的输入
echo $this->formCollection($form->get('some-name'));
(或 formCollection 之类的)在视图脚本中。
我想将集合的每个输入包装到 div 中。我的想法是遍历这个输入集合以提取输入。
我该怎么做?
【问题讨论】:
标签: view zend-framework2 renderer