drngnh708353 2017-02-06 08:04
浏览 28
已采纳

如何在Smarty中编写PHP语法?

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.

  • 写回答

2条回答 默认 最新

  • dongyuan1984 2017-02-06 08:23
    关注

    Try this:

    {if isset($value)}
        $value['phone']
    {/if}
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?