How To Remove All DtDdWrappers and Labels on Zend

2019-01-14 08:34发布

I know I can remove the extra stuff from each element individually like so

$button ->removeDecorator('DtDdWrapper')
        ->removeDecorator('HtmlTag')
     ->removeDecorator('Label');

I was wondering if I can achieve the same for all my elements in a zend form?
And how does one remove the dl wrapping the form?

7条回答
男人必须洒脱
2楼-- · 2019-01-14 09:27

try this:

foreach ($form->getElements() as $element) {
    $element->removeDecorator('DtDdWrapper')
        ->removeDecorator('HtmlTag')
        ->removeDecorator('Label');
}

or

foreach ($form->getElements() as $element) {
    $element->clearDecorators();
}
查看更多
登录 后发表回答