通过Smarty从PHP数组呈现HTML
以下是Smarty模板文件的内容通过Smarty从PHP数组呈现HTML,php,html,arrays,tags,smarty,Php,Html,Arrays,Tags,Smarty,以下是Smarty模板文件的内容 {foreach from=$productcustomfields item=customfield} <tr> <td class="fieldarea">{$customfield.name}:</td> <td>{$customfield.value}</td> </tr> {/foreach} {foreach from=$productcustomfields item
{foreach from=$productcustomfields item=customfield}
<tr>
<td class="fieldarea">{$customfield.name}:</td>
<td>{$customfield.value}</td>
</tr>
{/foreach}
{foreach from=$productcustomfields item=customfield}
{$customfield.name}:
{$customfield.value}
{/foreach}
当{$customfield.value}呈现在屏幕上时,该数组值中的所有HTML标记在浏览器中显示为纯文本。如何让Smarty真正呈现HTML标记,而不是将它们作为文本
例如,如果$customfield.value的值为
<strong>Hello</strong>
你好
它在浏览器中的显示方式与此相同,而不是像它应该显示的那样
{$customfield.value nofilter}
(请参阅)您的Smarty对象上是否有
registerFilter('variable','htmlspecialchars')
?我不能确定。此模板文件来自编码和许可软件,因此我无法访问该信息。