2011-04-07 44 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);