Smarty错误:修饰符'unescape'未实现

问题描述 投票:3回答:1

我想聪明地显示html变量内容,就像它是html文件的一部分,所以我使用“unes​​cape”修饰符,就像它显示here

<div id="add">{if $add}{$add|unescape:"html"}{/if}</div>

但我得到:

Fatal error: Smarty error: [in xxx.html line 20]: [plugin] modifier 'unescape' is not implemented (core.load_plugins.php, line 118) in
XXX/inc/lib/Smarty/Smarty.class.php on line 1095

我的插件目录在正确的位置:

Smarty$ ls
Config_File.class.php  Smarty.class.php  Smarty_Compiler.class.php  debug.tpl  error_log  internals  plugins

什么可能是错的,我怎么能做我想要的?

php html smarty
1个回答
3
投票

尝试通过PHP处理它:

<div id="add">
    {if $add}
        {php}
            echo html_entity_decode($add);
        {/php}
    {/if}
</div>

您可以使用qazxsw poi功能来满足您的需求,或者您可以使用qazxsw poi或qazxsw poi作为Smarty html_entity_decode功能建议。

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