English 中文(简体)
Se4t Escaping for Zend_Form element description to false
原标题:

I m having some trouble dealing with this. This is inside my Zend_Form:

$about = $this->addElement( textarea , about , array( label => About: , description => some <strong>description</strong> , required => false, filters => array( StringTrim ), validators => array( array( validator => StringLength , options => array(0, 1024)), ) ));

So for this about element I should have a description some description .

The problem is the description is being escaped so what I get is some description...

Now If I try to use $about->setDescription("some-text"); instead of setting the description key my description doesn t show. If I try to do anything that is described here ( http://devzone.zend.com/article/3450#comments-3486 ) either my form disappears or if I try to get the decorator I get null, so I get an error if I try to call the $decorator->setOption() method.

Any ideas?

最佳回答

Okay, I don t know why this happens, maybe it is even intended to (maybe I failed reading all the documentation of Zend_Form).

Anyway, in the view script where I retrieve the form I can make it work...

How? <?php $this->form->getElement("about")->getDecorator("description")->setEscape(false); ?>

问题回答

暂无回答




相关问题
How do I escape a string for a shell command in node?

In nodejs, the only way to execute external commands is via sys.exec(cmd). I d like to call an external command and give it data via stdin. In nodejs there does yet not appear to be a way to open a ...

Do I need to escape this?

It might be a bit unusual, but I need to echo <?php. However, I think that PHP treats it as an actual <?php and starts executing code instead of treating it as a string. How can I escape <?...

热门标签