我在CakePHP 2.x中使用Ckeditor 3.1版
我可以让编辑器加载并替换textarea。 HTML将使用HTML格式标记保存到数据库中,如下所示:
<p> This is a test</p>
当我将其插入CkEditor时,我会在编辑器界面中显示以下内容:
<p> This is a test</p>
如果我在设置CkEditor之前使用html_entity_decode,我会在编辑器界面中看到:
This is a test
这就是我在edit.ctp Cake视图中加载编辑器的方法:
$bio = $this->data['Club']['bio'];
echo $this->Cksource->ckeditor('Club.bio', array('value'=>$bio) );
如何强制CkEditor解析传入的HTML以使其格式化而不显示HTML标记?
编辑:
我手动覆盖了Cake Helper,以便输出的Javascript如下所示:
CKEDITOR.replace('data[Club][bio]',
{
entities: false,
basicEntities: false,
entities_greek: false,
entities_latin: false,
htmlDecodeOutput: true
}
);
我假设正在将相应的表单字段转换为ckeditor实例,因此第一个参数是正确的。我也尝试过没有运气更新config.js。