List Info

Thread: Re: formLabel and escaping




Re: formLabel and escaping
user name
2008-05-08 17:36:51
Matthew Weier O'Phinney wrote:
> -- Teemu Välimäki <teemu.valimakiiki.fi> wrote
> (on Tuesday, 04 March 2008, 03:29 PM +0200):
>> In Zend_Form I'd like to have label linked, but
formLabel escapes output. I 
>> was wondering if it would be smart to add $escape =
true parameter to 
>> formLabel to control escaping? The problem what I
have is currently with 
>> Zend_Form so I could create a workaround, but it
could pop up later on when 
>> using View Helpers.
> 
> Actually, you already can do this 
> 
> Grab your label decorator:
> 
>     $label = $element->getDecorator('label');
> 
> And set the escape option to false (so you can render
HTML in the
> label):
> 
>     $label->setOption('escape', false);
> 
> Alternately, you can do this at decorator creation time
by passing the
> escape option:
> 
>     $element->addDecorator('label', array('escape'
=> false));
> 
> When $escape is true (the default), the label will be
escaped using the
> view object's escaping mechanism. When false, no
escaping will be done.
> 
> The escape flag is already built into the view helpers,
and can be
> passed into the $attribs array each form view helper
accepts (though not
> all of them honor it at this point).
> 


Any way to do this through a Zend_Config ini file?

-Joshua-


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )