为什么在做Laravel时会打印<p>?

我正在尝试打印一些以HTML格式设置的内容,但它只打印代码

<td>{{ html_entity_decode($p->content) }}</td>

This code prints this: <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Pariatur quidem alias fugit hic incidunt consequuntur quasi fuga tenetur sit perferendis nisi dignissimos accusantium ab expedita temporibus velit dolorum, ipsam explicabo</p>

任何的想法?没有html_entity_decode,情况甚至更糟。

评论
客官,不要
客官,不要

You are telling blade to escape it and so it prints the actual HTML, including the <p> tags. You have stored the tags within $p.

要修复,请使用未转义的刀片语法:

<td>{!! $p->content !!}</td>
点赞
评论