2008年9月8日星期一

[fw-mvc] Zend_Form html entities problem

Hi everyone,

quick question; I am trying to create a dropdown box with all the country codes and names. The problem is, however, that many of these countries need html entities (as they contain umlauts, accent graves etcetera). If I use html entities like ë it will be converted by zend_form to ¨
Does anyone know how to circumvent this?

Sample code:

$this->addElement('select', 'country', array(
    'validators' => array(
        array(
         'regex', false, array('/^[A-Z]{2}$/',
),
),
    'label'=>'Land:',
    'required' => true,
'multiOptions' => array(
'AF'=>'Afghanistan','AL'=>'Albanië','DZ'=>'Algerije','AS'=>'Amerikaanse Samoa','AD'=>'Andorra','AO'=>'Angola','AI'=>'Anguilla',
),
'decorators' => $this->elementDecorators
));

Thanks for helping!


Regards,
Pieter

没有评论: