【发布时间】:2016-02-12 02:15:00
【问题描述】:
我正在为我的 Laravel 5.1 自定义 CMS 使用 CKeditor。当我在我的视图中请求数据库中存储页面的内容时,它们会出现带有<p>Hello world</p> 之类的 HTML 标记。
我已经使用html_entity_decode() 有和没有指定的字符集无济于事。
还值得一提的是,在我看来,我使用的是 Blade 模板引擎。因此,我的演示代码看起来像
$post->content = '<p>Hello world</p>'; // from the database from controller
{{html_entity_decode($post->content)}} //did not decode
我也尝试在我的控制器中使用它,但它没有改变任何类似的东西
$post->content = html_entity_decode($post->content); //before sending it to the view
我需要你的帮助来解决这个问题。
【问题讨论】:
标签: html laravel-5 ckeditor decoding