【发布时间】:2013-10-14 20:54:43
【问题描述】:
这是 Smarty 模板文件的内容...
{foreach from=$productcustomfields item=customfield}
<tr>
<td class="fieldarea">{$customfield.name}:</td>
<td>{$customfield.value}</td>
</tr>
{/foreach}
当 {$customfield.value} 在屏幕上呈现时,来自该数组值的任何 HTML 标记都会在浏览器中显示为纯文本。如何让 Smarty 实际呈现 HTML 标签而不是将它们作为文字文本?
例如,如果 $customfield.value 的值是...
<strong>Hello</strong>
它会在浏览器中显示,而不是应有的 Hello。
【问题讨论】:
-
您的 Smarty 对象上是否有
registerFilter('variable','htmlspecialchars')? -
我不能确定。此模板文件来自编码和许可软件,因此我无权访问该信息。
标签: php html arrays tags smarty