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}
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?