Use php into smarty templates

You can easily execute php into smarty templates using the {php} tag :

{if $smarty.get.id_category|intval}
    {php}
         global $cookie;
         Configuration::get('PW_SORT_ENABLE');
    {/php}
{/if}

To access PHP variables in {php} blocks, you will need to use the PHP global keyword.

Leave a Reply