2010年10月25日星期一

Re: [fw-mvc] Forms and HTML

On 10/25/2010 1:00 PM, Thomas List wrote:
> Helllo,
>
> I posted this last week, and I am still having a problem with getting HTML integrated with my form. I am setting the escape value to false, but it still doesn't seem to render the HTML for the label, for example, I have this element in my form:
>
> $this->addElement('select','types', array(
> 'label' => '<span>font: 14pt Frutiger LT Std;color:#00B3FF;><b>What type of home do you live in:</b></span><br/>',
> 'escape' => false,
> 'required' => true,
> 'multiOptions' => array( 'Existing Home' => 'Existing Home', 'New Construction' => 'New Construction', 'Condominium' => 'Condominium', 'Apartment' => 'Apartment',),));
>
> I'm not quite sure what I am missing, but I can't seem to render HTML for the label. Is there something else I need to add to my form class?
>
> Thank You,
> Thomas List
>

Thomas,

After the element has been added to the form, try the following:

$this->types->getDecorator('Label')->setOption('escape', false);

Rob

没有评论: