我希望智能显示html变量内容,就像它是html文件的一部分一样,所以我使用了“smarty”修饰符,就像它显示这里一样。
<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有什么不对的,我怎么能做我想做的?
发布于 2015-04-27 07:13:23
尝试通过php处理它:
<div id="add">
{if $add}
{php}
echo html_entity_decode($add);
{/php}
{/if}
</div>您可以使用解码函数来满足您的需要,也可以像Smarty披风函数建议的那样使用htmlspecialchars_decode()或mb_convert_encoding()。
https://stackoverflow.com/questions/29869923
复制相似问题