如何防止 Zend Form Select 上的转义:Zend Framework
如何防止在 zend form elemnt 上转义 html?我的代码根本不起作用,
$this->addElement('Select', 'forum_icon', array(
'label' => 'Forum Icon',
'value' => $this->_forum->FORUM_ICON,
'escape' => false,
'multiOptions' => $icons
));
我尝试了另一种方法,但它仍然不起作用,
$this->forum_icon->setAttrib('escape', false);
提前谢谢,
布莱恩
how to prevent escaping html on zend form elemnt ? My code is not work at all
$this->addElement('Select', 'forum_icon', array(
'label' => 'Forum Icon',
'value' => $this->_forum->FORUM_ICON,
'escape' => false,
'multiOptions' => $icons
));
i try another method but it still not work
$this->forum_icon->setAttrib('escape', false);
thanks in advance,
Brian
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以为 Select 元素实现装饰器,为具有未转义值的 select 生成 HTML。例如:
请参阅以下文章了解更多信息:
http:// weierophinney.net/matthew/archives/212-The-simplest-Zend_Form-decorator.html
http://codeutopia.net/blog/2008/08/07/zend_form-装饰器提示/
You can implement your decorator for Select element that generates HTML for select with unescaped value. For example:
Refer to these articles for more information:
http://weierophinney.net/matthew/archives/212-The-simplest-Zend_Form-decorator.html
http://codeutopia.net/blog/2008/08/07/zend_form-decorator-tips/