如何使用smarty显示特殊字符,例如'%'?

问题描述 投票:0回答:2

我正在设计一个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>
smarty prestashop-1.7
2个回答
0
投票

尝试添加%的HTML代码并使用smarty管道来转义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' }

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.'>和它的作品

© www.soinside.com 2019 - 2024. All rights reserved.