ZF-5081: Zend_View_Helper_FormSelect escaping html entities
Description
I am trying to create a select with currency and Im providing it a HTML entity for the Euro, which then gets encoded again
$this->addElement('select', 'Currency', array(
'label' => '/h',
'multiOptions' => array('null' => 'Select...', 'EUR' => '€', 'GBP' => '£', 'USD' => '$' )
))
ouputs
Select...€£$
What Id like is to be able to switch escaping off perhaps. I can see the need to do this on a per option basis. Providing a Euro symbol does not escape to €
Update : I found out how to do non formatted text so updated my example to be more accurate
Thanks :)
Comments
Posted by Loïc Frering (loic.frering) on 2008-12-01T03:33:12.000+0000
It would also be nice to render $nbsp; :)
Posted by Dan Entous (dan_nl) on 2009-05-04T19:21:35.000+0000
Is it possible to use utf-8 in your application and then use the actual € and £ symbols just like the $ symbol?
Posted by Matthew Weier O'Phinney (matthew) on 2009-05-05T05:31:22.000+0000
Tell Zend_View to use utf-8 encoding: $view->setEncoding('utf-8') if you want to use UTF-8 symbols directly.
As for the original reporter's issue, you can do this already. Pull the 'ViewHelper' decorator from the element, and set the 'escape' option to a boolean false: