Search code examples
phpcodeignitersyntaxsmarty

How to write PHP Syntax in Smarty?


I want to know how to write php syntax in smarty template(.tpl).

For example I'm using below php syntax in Pure Codeigniter(No Smarty include) and it's working perfectly.

<?= isset($value) ? $value['phone'] : '' ?>

But in Smarty, It's not work. How should write this? Please suggest me.


Solution

  • Try this:

    {if isset($value)}
        $value['phone']
    {/if}