ZF-9403: Zend_Form_Decorator_Label does not show the "class" attribute

Issue Type: Bug Created: 2010-03-11T07:11:26.000+0000 Last Updated: 2012-11-20T21:37:25.000+0000 Status: Open Fix version(s): Reporter: Henrique Moody (henriquemoody) Assignee: None Tags: - Zend_Form

Related issues: Attachments:


The correct behavior of the decorator is to show the class "required" if the field is required or "optional" if the field is not required, but the decorator don't do it.

The lines 318-320 of the file Zend/Form/Decorator/Label.php are:

<pre class="highlight">
            $decorator = new Zend_Form_Decorator_HtmlTag();
            $decorator->setOptions(array('tag' => $tag,
                                         'id'  => $this->getElement()->getName() . '-label'));

But the correct must be:

<pre class="highlight">
            $decorator = new Zend_Form_Decorator_HtmlTag();
            $decorator->setOptions(array('tag' => $tag,
                                         'class'  => $class,
                                         'id'  => $this->getElement()->getName() . '-label'));

Another thing: There is no way to add one more class to the label decorator. In future versions would be possible?


Posted by Christian Albrecht (alab) on 2010-04-05T10:27:40.000+0000

A "same same but different" Issue for Zend_Form_Decorator_Description is this ZF-8704

Posted by Henrique Moody (henriquemoody) on 2010-06-28T21:21:37.000+0000

This task must be rejected becouse the decorator is working perfectly. The classes are in the "label" HTML element, and not in the label's wrapper. I'm sorry for not having paid more attention.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.