Smarty 3:如果,混合条件&运营商 [英] Smarty 3: if, mixed conditions & operators

查看:182
本文介绍了Smarty 3:如果,混合条件&运营商的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗯......你能告诉我为什么会这样吗:

well... can you tell me why this works:

{if !$conta|contains:"word1" && ($product->id_category_default < 388 || $product->id_category_default > 475)}

而这不是:

{if (!$conta|contains:"word1" || !$conta|contains:"word2") && ($product->id_category_default < 388 || $product->id_category_default > 475)}

语法错误在哪里?

推荐答案

请改为尝试:

{if !($conta|contains:"word1" || $conta|contains:"word2") && ($product->id_category_default < 388 ||  $product->id_category_default > 475)}

这篇关于Smarty 3:如果,混合条件&amp;运营商的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆