Laravel Laravel Admin PHP 技术 Laravel-admin 模型详情显示 html 的问题 setEscape 2020-06-07 01:02 2688 更新于 2020-06-07 01:02 ``` $show->description('描述'); ``` 当 `description` 是html 内容时,html的标签会被转义;查找文档无果,查看源码找到了解决办法 `vendor\encore\laravel-admin\src\Show\Field.php` ``` /** * Set escape or not for this field. * * @param bool $escape * * @return $this */ public function setEscape($escape = true) { $this->escape = $escape; return $this; } ``` 调用 setEscape 方法即可 ``` $show->description('描述')->setEscape(false); ```