我正在使用 Smarty 模板系统,似乎找不到任何有关如何执行此操作的文档......
我想检查通过 Post 发送的参数。 如果参数last7
、last30
、last60
或full
不存在,我想显示"This is not working!"
。 如果这些参数中的任何一个已发布,我希望显示"This is working"
。
有谁知道如何在 Smarty 模板系统中执行此操作?
Smarty 文档没有任何关于使用 if/else 和参数的信息......
自从我使用 Smarty 以来已经有很长时间了(为什么不直接使用 PHP),但这似乎是正确的:
{if isset($smarty.post.last7, $smarty.post.last30, $smarty.post.last60)}
This is working
{else}
This is not working!
{/if}