我想用smarty渲染我的原始HTML。
{if !empty($brand.description)}
{$brand.description}
{/if}
原始文本包含空格和文本返回,但在显示时,HTML显示为纯文本。
此外,我试图添加{$brand.description|strip_tags:'UTF-8'}
作为我的字符串的过滤器。但是它只是在删除我的HTML。
我的smarty模板如何将此字符串呈现为纯HTML?
答案是…
{$brand.description nofilter}
另外,您可以通过更改默认smarty行为来禁用此指示器:
$smarty->setEscapeHtml(false);