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'));
}
}
精彩评论