views:

374

answers:

3

I'm working with the Multicheckbox element and trying to figure out how to disable "escape" in the FormMulticheckbox helper. I've managed to send an escape parameter to the "description" helper, and that works fine (see "escape" => false below):

$this->setDecorators(array(
    "ViewHelper",
    "Errors",
    array(array("internal" => "HtmlTag"), array(
       "tag"   => "div", 
       "class" =>"multi-internal",
    )),
    "LabelWithHelp",
    array("Description", array(
        "class"  => "ui-corner-all ui-state-highlight help",
        "escape" => false,
        "tag"    => "div",
    )),
    array(array("element" => "HtmlTag"), array(
        "tag"   => "div", 
        "class" =>"multi",
    )),
));

But I can't figure out what decorator or element to add something like that to to remove escaped output from the label that is rendered by Zend_View_Helper_FormRadio (which Zend_View_Helper_FormMultiCheckbox extends from) on line 138:

if ($escape) {
    $opt_label = $this->view->escape($opt_label);
}

It's checking if escaping is on, so there's got to be a setting somewhere. Just not sure where to put it :/

Thanks!

A: 

Ah, shoot. Figured it out. It's supposed to be applied to the element, not the decorator:

$this->setAttrib("escape", false);
Typeoneerror
+1  A: 

Have you tried:

$this->setAttrib( 'escape', false );

?

fireeyedboy
Ooops, I see you found it yourself already :)
fireeyedboy
Voted up for effort! :)
Typeoneerror
Thank you TypeOneError. I appreciate it. :)
fireeyedboy
A: 

$element->escape = false

darka