如何用“ smarty”显示特殊字符,例如“%”?

时间:2019-03-25 00:00:34

标签: smarty prestashop-1.7

我正在设计一个prestashop主题,但是我的smarty模板引擎有问题。

我写了一个带有特殊字符'%'的文本,但是什么也不显示。

<p>
  {l s='Save hundreds of hours of manual work, be more productive and impress your audience with visually appealing slides that are 100% editable.' d='Shop.Theme.Global'}
</p>

2 个答案:

答案 0 :(得分:0)

尝试为%添加HTML代码,并使用智能管道来转义HTML字符。

 {l s='Save hundreds of hours of manual work, be more productive and impress your audience with visually appealing slides that are 100&#37; editable.'|escape:'html' }

答案 1 :(得分:0)

Melvita,但我提出了%%。<l s='Save hundreds of hours of manual work, be more productive and impress your audience with visually appealing slides that are 100%% editable.'>可以解决