Hi Dave,
The problem is that the Label decorator on the form uses a View Helper in
the background that, by default, is escaping it's content using
htmlspecialchars(). The solution is to replace that default decorator with a
custom one where you pass an extra parameter to the Label decorator setting
"escape" to be "false".
For example, I define decorator options in arrays in a Zend_Form subclass in
the form:
protected $_standardElementDecorator = array(
'ViewHelper',
array('LabelError', array('escape'=>false)),
array('HtmlTag', array('tag'=>'li'))
);
LabelError is a Label Decorator subclass which automatically adds form error
messages to the Label (I use really short messages for this style). But
otherwise the principle is the same - the array setting the key "escape" to
"false" is an options array eventually passed to the underlying FormLabel
View Helper which prevents the escaping which in your example causes the
escaped output.
Depending on your own method of describing a Zend_Form instance, similar
idea applies - you need to get that escape option integrated.
Best regards,
Paddy
DaveCool wrote:
>
> Hi everyone, I'm new to the forum and Zend_framework so hopefully this
> doesn't sound stupid.
>
> I'm working with zend_form to make a signup page and at the bottom I need
> to put a check box for agreeing to the terms of use. I need to make the
> terms of use a link to the terms of use page, but it seems like zend form
> doesn't allow html within a label tag. Is there any way around this? any
> help would be greatly appreciated.
>
> here's the snippet of code from my form, and the output.
> (I attached it because the anchor tags were rendering as links. heh)
> http://www.nabble.com/file/p17670427/code.txt code.txt
>
-----
Pádraic Brady
http://blog.astrumfutura.com
http://www.patternsforphp.com
OpenID Europe Foundation - Irish Representative
--
View this message in context:
http://www.nabble.com/zend_form-help%21-tp17670427p17673970.html
Sent from the Zend Framework mailing list archive at Nabble.com.