views:

182

answers:

1

I am rendering a Zend Form Checkbox and I would like to render some custom html at its setlabel property.

My form construct model

$terms = new Zend_Form_Element_Checkbox('confirm_terms');

In my View Script

$this->form->confirm_terms->setLabel('<a href="'.'/index/terms'.'">Terms of Service</a>');

However since setLabel escapes the output it rendered as it is.

Any creative ways of rendering the setlabel property as CustomHTML?

+1  A: 

You need to disable the auto-escaping of the label, following your example, you would use this code:

$this->form->confirm_terms->getDecorator('Label')->setOption('escape', false);
Bittarman