开发者

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

开发者 https://www.devze.com 2023-03-17 18:31 出处:网络
Usually I would set up a send element by using the following $question = new Zend_Form_Element_Text (\"question\");

Usually I would set up a send element by using the following

$question = new Zend_Form_Element_Text ("question");
$question->setLabel("Question")
  ->setAttrib开发者_运维百科('class', 'bob');

Here I have set a class around an element but how do I set it for the label instead?


From ZF Documentation:

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

精彩评论

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