什么是创造的语法如果多个ID的一个.tpl文件中的语句?

问题描述 投票:0回答:2

我这一小段代码:{if $smarty.get.id_cms == 1 }

我想每一个CMS页面上迭代id为1〜20而不是创建19个if语句。

我试图用“”和‘’没有任何成功。

使用“”或者‘;’打破页到白度。这表明我的“猜”的语法是错误的。

if-statement prestashop smarty
2个回答
0
投票

我一定是受到影响。

这当然是一样简单

{if in_array($smarty.get.id_cms, array (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20))}

0
投票

尝试:

{if $smarty.get.id_cms => 1 &&  $smarty.get.id_cms <= 1}

问候

© www.soinside.com 2019 - 2024. All rights reserved.