views:

23

answers:

1

Hi,

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

Thanks

+1  A: 

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'));
    }
}
Mike
Thank you very much Mike!
Yosef