开发者

Zend_Form:: how remove all label from zend form?$title->removeDecorator('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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜