如何将属性设置为标签而不是zend表单中的元素?


How do I set an Attrib to the label and not the element in a zend form

通常我会使用下面的

来设置send元素
$question = new Zend_Form_Element_Text ("question");
$question->setLabel("Question")
  ->setAttrib('class', 'bob');

这里我已经设置了一个类围绕一个元素,但我如何设置它的标签,而不是?

来自ZF Documentation:

$label = $element->getDecorator('label');
$label->setOption('class', 'bob');