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

Description

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:


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

But the correct must be:


            $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?

Comments

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

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.