在 Zend_Form_Element_Text 元素中禁用转义字符串
我有以下代码:
// agregamos el campo de fecha de nacimiento
$this->direccion = new Zend_Form_Element_Text('direccion');
$this->direccion->setLabel('Dirección:');
$this->direccion->setAttrib('escape', false);
$this->direccion->getDecorator('Label')->setOption('escape',false);
$this->direccion->setRequired(true);
$this->addElement($this->direccion);
出于某种原因,在尝试将 setValue() 设置为“Larrañaga”时,内容被转义,并且输入值中没有显示任何内容。请注意,setAttrib('escape', false) 应用于元素,如几篇文章中所建议的。
有什么想法吗?谢谢!
I have the following piece of code:
// agregamos el campo de fecha de nacimiento
$this->direccion = new Zend_Form_Element_Text('direccion');
$this->direccion->setLabel('Dirección:');
$this->direccion->setAttrib('escape', false);
$this->direccion->getDecorator('Label')->setOption('escape',false);
$this->direccion->setRequired(true);
$this->addElement($this->direccion);
For some reason, while trying to setValue() to "Larrañaga", the content is escaped, and nothing is shown in the input's value. Note that setAttrib('escape', false) is applied to the element, as suggested in several posts.
Any idea? Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将此行添加到您的
init()
方法中:Add this line into your
init()
method: