dongxie9169 2014-11-21 19:41
浏览 24
已采纳

Smarty if / else使用Post参数?

I'm using the Smarty template system and can't seem to find any documentation on how to do this...

I want to check what parameters are sent through Post. If the parameters last7, last30, last60, or full DO NOT exist, I want to display "This is not working!". If any of those parameters have been posted, I want "This is working" to be displayed.

Does anyone know how to do this in the Smarty template system?

The Smarty docs don't have any info that I can find on using if/else with parameters...

  • 写回答

1条回答 默认 最新

  • doushe2513 2014-11-21 19:46
    关注

    Been a long time since I used Smarty (why not just use PHP), but this seems right:

    {if isset($smarty.post.last7, $smarty.post.last30, $smarty.post.last60)}
        This is working
    {else}
        This is not working!
    {/if}
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?