我有一个工具提示:
<i
class="fa fa-info-circle infopoint"
role="button"
data-toggle="popover"
data-placement="top"
data-trigger="hover"
data-content="<a href='qwe'>URL text</a>."
></i>
我需要显示完全一样的内容,而无需在链接中进行转换。我在Blade模板中编写它。我已经尝试过{!! !!}
和{{ }}
和html_entity_decode
。
答案 0 :(得分:4)
{{3}}应该可以解决问题
htmlspecialchars('<i
class="fa fa-info-circle infopoint"
role="button"
data-toggle="popover"
data-placement="top"
data-trigger="hover"
data-content="<a href="qwe">URL text</a>."
></i>');
如果您只希望data-content
显示为文本
data-content=" {{ htmlspecialchars("<a href='qwe'>Your html code</a>") }}"