Smarty error: "unescape" modifier not implemented

I want smarty to display the content of the html variable as it is part of the html file, so I am using the unescape modifier as shown here :

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

      

But I am getting:

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

      

My plugins directory in the right place:

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

      

What could be wrong and how can I do what I want?

+3


source to share


1 answer


Try to figure it out through php:

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

      



You can play arround with the function html_entity_decode, to fit your needs, or you can use htmlspecialchars_decode()

, or mb_convert_encoding()

how to offer a function of the Smarty unascape .

+3


source







All Articles