-- Joshua Ross <[EMAIL PROTECTED]> wrote
(on Thursday, 08 May 2008, 03:36 PM -0700):
> Matthew Weier O'Phinney wrote:
> > -- Teemu Välimäki <[EMAIL PROTECTED]> 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?
Yes -- pass it in the options array for the decorator:
element.options.decorators.label.decorator = "Label"
element.options.decorators.label.options.escape = 0
--
Matthew Weier O'Phinney
Software Architect | [EMAIL PROTECTED]
Zend - The PHP Company | http://www.zend.com/