On Mon, Nov 19, 2012 at 8:23 AM, poashoas <pdan...@scarlet.nl> wrote: > Is there any decorator shizzle or whatever to put HTML in form labels?? > I have the following (and I have put escape => false all over the place) > but it outputs it as & lt ;span class=& quot ;icon- blah blah blah:
I'm not sure where this is happening, to be honest. The FormLabel view helper pulls the content off of the element, but does not escape that label content -- you can see in line 145 of that class that it simply returns "$openTag . $labelContent . $this->closeTag()". As such, it _shouldn't_ be escaping that content. Can you file an issue with a small reproduce case, please? (https://github.com/zendframework/zf2/issues) > $values = array('icon-trash', '<s pan class="icon-trash"></s pan>'>); > > $form->add(array( > 'name' => 'icon', > 'type' => 'Zend\Form\Element\Radio', > 'escape' => false, > 'attributes' => array( > 'type' => 'radio', > 'escape' => false, > ), > 'options' => array( > 'label' => 'icoon', > 'label_attributes' => array( > 'class' => 'sub-element radio', > 'escape' => false, > ), > 'value_options' => $values, > ), > )); > > > in the view: > > echo $this->form()->openTag($form); > > foreach ($form as $el) { > $elNaam = $el->getName(); > $element = $form->get($elNaam); > echo $this->formRow($element); > } > > echo $this->form()->closeTag($form); > > > > -- > View this message in context: > http://zend-framework-community.634137.n4.nabble.com/Please-no-HTML-escape-form-label-tp4658168.html > Sent from the Zend Framework mailing list archive at Nabble.com. > > -- > List: fw-general@lists.zend.com > Info: http://framework.zend.com/archives > Unsubscribe: fw-general-unsubscr...@lists.zend.com > > -- Matthew Weier O'Phinney Project Lead | matt...@zend.com Zend Framework | http://framework.zend.com/ PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc -- List: fw-general@lists.zend.com Info: http://framework.zend.com/archives Unsubscribe: fw-general-unsubscr...@lists.zend.com