2011-11-30 45 views
0

我有下面的代碼:禁止逃亡串

// 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)應用於元素,正如幾篇文章中所建議的。

有什麼想法?謝謝!

回答

2

添加此行到您的init()方法:

$this->getView()->setEscape('stripslashes'); 
+0

這是一個快速的答案,謝謝! = D –

+0

@JoaquínL.Robles很高興爲您提供幫助;) –