سؤال

we render a German encoded string übermitteln from a file.

Problem: zend form does not consider ü as a character and displays the same value on my submit button.

Quick fix we got:

html_entity_decode($form->submit->renderViewHelper())

However we have lot of forms and it is troublesome job to make changes everywhere. So what is the proper way of achieving this.

هل كانت مفيدة؟

المحلول

ZF escapes labels by default. This is a good thing. It's not that Zend Form "doesn't consider ü a character", it's that you are supply an already escaped string so the escaping is happening twice. (View source and you'll see ü.)

You can either run the data you're reading in from the file through html_entity_decode() (preferred), or disabling escaping on the submit element's label decorator:

$form->submit->getDecorator('label')->setOption('escape', false);
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top