2011-04-07 20 views
0

在哪個函數可以在表單中顯示之前更改字段的值?Symfony表單框架 - 在編輯之前更改值

我與tinyMce(see here)有一個奇怪的錯誤,並且我想在它顯示在textarea中之前對內容執行htmlentities()。

我在哪裏修改字段的值,然後將其顯示在窗體中?

編輯

這工作,但它似乎剝奪任何HTML它不理解:(

$this->content = $this->getRoute()->getObject(); 
$this->content->setContents(htmlentities($this->content->getContents(),ENT_QUOTES,'UTF-8')); 
$this->form = $this->configuration->getForm($this->content); 

回答

0

This wor ks:

$this->content = $this->getRoute()->getObject(); 

$this->content->setContents(htmlentities($this->content->getContents(),ENT_QUOTES,'UTF-8')); 

$this->form = $this->configuration->getForm($this->content);