Issues

ZF-8722: Cannot set ´escape´ option for label(s) of ´multiOptions´ using Zend_Form_Element_Radio

Issue Type: Sub-task Created: 2010-01-06T04:30:13.000+0000 Last Updated: 2012-11-20T21:38:03.000+0000 Status: Open Fix version(s): Reporter: Webdevilopers (tridem) Assignee: None Tags: - Zend_Form

Related issues: - ZF-7403

Attachments:

Description

I try to insert HTML into labels for a Zend_Form_Element_Radio element. But I can't find the correct way to set the "escape" option. Is there any?

<pre class="highlight">
$element = new Zend_Form_Element_Radio('image');
$element->setMultiOptions(array(
    '1' => '<img alt="image_add.png" src="/images/icons/png/image_add.png"></img>',
    '2' => '<img alt="image_delete.png" src="/images/icons/png/image_delete.png"></img>'
));
$element->setDecorators(array(
    array('ViewHelper', array(
        'escape' => false
    )),
    array('Label', array(
        'escape' => false
    )),
    array(array('div' => 'HtmlTag'), array('tag' => 'div'))
));

Comments

Posted by Webdevilopers (tridem) on 2010-06-22T05:24:52.000+0000

What is the current status for this issue? All the changes have become confusing, sorry!

I tried this to achieve set "esacpe" to false - is it a good solution?

<pre class="highlight">
$element = new Zend_Form_Element_Radio('image');
$element->setMultiOptions(array(
    '1' => '<img alt="image_add.png" src="/images/icons/png/image_add.png"></img>',
    '2' => '<img alt="image_delete.png" src="/images/icons/png/image_delete.png"></img>'
));
$element->setAttrib("escape", false);
/*
$element->setDecorators(array(
    array('ViewHelper', array(
        'escape' => false
    )),
    array('Label', array(
        'escape' => false
    )),
    array(array('div' => 'HtmlTag'), array('tag' => 'div'))
));
*/

Posted by Christian Albrecht (alab) on 2010-06-30T14:34:24.000+0000

Tridem, that needs to be done consistent across different Decorators|Views|Elements, the status is - on some Elements someone implemented escape = false on others it lacks this feature, your best bet is to read the Sources.

One thing i wonder though is whether to set escape = false for every escaped output at once or split it into multiple keys for each escaped value|attribute.

Have you found an issue?

See the Overview section for more details.

Copyright

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

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

Contacts