开发者

Zend_Form:: how remove all label from zend form?$title->removeDecorator('Label'); for one but for all elements?

开发者 https://www.devze.com 2023-01-06 03:50 出处:网络
Zend_Form:: how remove all label from zend form?$title->re开发者_如何学PythonmoveDecorator(\'Label\'); for one but for all elements?

Zend_Form:: how remove all label from zend form?$title->re开发者_如何学PythonmoveDecorator('Label'); for one but for all elements?

Thanks


This would work in a pinch.

class My_Form extends Zend_Form
{
    public function init(){
        foreach($this->getElements() as $element)
        {
            $element->removeDecorator('Label');
        }
    }
}

If you want to set the decorators for all elements something like this should work:

class My_Form extends Zend_Form
{
    public function init(){
        $this->setElementDecorators(array(
        'ViewHelper',
        array('HtmlTag', array('tag' => 'div'));
    }
}
0

精彩评论

暂无评论...
验证码 换一张
取 消