I'm trying to add a class (the same) to each label in a group of radio buttons.
This is my code:
$linkedin_share = new Zend_Form_Element_Radio('linkedin_share', array('escape' => false));
$linkedin_share->setDecorators(array('ViewHelper','Errors', array('Label', array('class' => 'TEST'))))
->addMultiOption('none', $this->getView()->translate('None'))
->addMultiOption('icon', '<img src="'.$this->getView()->baseUrl().'/images/admin/icons/social_media_share/linkedin.png'.'"/>')
->addMultiOption('counter', '<img src="'.$this->getView()->baseUrl().'/images/admin/icons/social_media_share/linkedin_share.jpg'.'"/>')
->setSeparator('')
->setAttrib('class', 'item_small_checkbox');
And this is my output:
<label for="linkedin_share-none">
<label for="linkedin_share-icon">
<label for="linkedin_share-counter">
This is my desired output:
<label for="linkedin_share-none" class="share_label_class">
<label for="linkedin_share-icon" class="share_label_class">
<label for="linkedin_share-counter" class="share_label_class">
The stupid thing is that it works for all my other form elements so far. I tried a million combinations and searched my ass off, but no matter what I try I can't add class to the label.
Ideas, solutions, suggestions are all very welcome! Thanks in advance!