显示带有html内容的smarty变量 [英] show a smarty variable with html content
本文介绍了显示带有html内容的smarty变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个带有html内容的smarty变量,例如:
$html="<strong>Content</strong><br/>etc etc"
.
我尝试将其显示为html格式.当显示像
{$html}
仅纯文本显示,不带格式.我尝试像:
{$html|unescape}
但随后会显示但未应用标签.你有什么建议吗?
I have a smarty variable with html content in it like:
$html="<strong>Content</strong><br/>etc etc"
.
I try to show it html-formatted. When showing it like
{$html}
only plain text appears without formatting. I try like:
{$html|unescape}
but then the tags are shown but not applied. Do you have any suggestions?
推荐答案
您应该尝试以下操作:
{$html|unescape:'html'}
也请查看手册:
http://www.smarty.net/docs/zh/language.modifier.unescape.tpl
这篇关于显示带有html内容的smarty变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文