当您查看
在下面的标记中,您会看到有一个带有 id 地址标签的 dt 和以下 dd,我想删除这些但保留
字段集。
要添加显示组,我在其中使用了这个 $this->addDisplayGroup(array(...), 'legend' => 'address');
添加每个元素后,我的表单初始化类。有没有我可以玩的装饰器来删除
我不想要的元素?
<form id="CreateAddress" enctype="application/x-www-form-urlencoded" action="" method="post">
<dl class="zend_form">
<dt id="address-label"> </dt>
<dd id="address-element">
<fieldset id="fieldset-address">
<legend>Address</legend>
<dl>
<dt id="addressLine1-label">
<label for="addressLine1" class="required">Address Line 1</label>
</dt>
<dd id="addressLine1-element">
<input type="text" name="addressLine1" id="addressLine1" value="">
</dd>
...etc...
</fieldset>
</dd>
...buttons...
</dl>
</form>
谢谢,
马丁
最佳答案
那么有什么关系呢?
$group = $form->getDisplayGroup ('the name of the group');
$group->removeDecorator ('Zend_Form_Decorator_DtDdWrapper');
关于zend-framework - Zend 表单显示组装饰器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4958890/