drvkf88226 2014-04-07 19:53
浏览 15

使用“if”和“else”与smarty模板系统?

Here's the variable I'm working with in Smarty:

{$productinfo.pid}

That variable will always be a number value. If they number is 8-76 then I want it to show a message that says "This Works". If it's 1-7 or above 76, I want it to show "Now Working".

Is anyone familiar with how to do this with smarty?

  • 写回答

1条回答 默认 最新

  • douhe2305 2014-04-07 19:58
    关注

    Smarty's documentation is good for this type of problem.

    {if $productinfo.pid < 8 or $productinfo.pid > 76 }
       NOT WORKING
    {else}
       WORKING
    {/if}
    
    评论

报告相同问题?

悬赏问题

  • ¥15 Oracle中如何从clob类型截取特定字符串后面的字符
  • ¥15 想通过pywinauto自动电机应用程序按钮,但是找不到应用程序按钮信息
  • ¥15 如何在炒股软件中,爬到我想看的日k线
  • ¥15 seatunnel 怎么配置Elasticsearch
  • ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.
  • ¥15 (标签-MATLAB|关键词-多址)
  • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
  • ¥500 52810做蓝牙接受端
  • ¥15 基于PLC的三轴机械手程序
  • ¥15 多址通信方式的抗噪声性能和系统容量对比