If statement 如何在if条件(ModX)中使用多个操作数
我正在为ModX使用if-extra。是否可以使用多个操作数,即以更短的方式编写此代码:If statement 如何在if条件(ModX)中使用多个操作数,if-statement,modx,modx-revolution,If Statement,Modx,Modx Revolution,我正在为ModX使用if-extra。是否可以使用多个操作数,即以更短的方式编写此代码: [[!If? &subject=`[[!getUrlParam? &name=`id`]]` &operator=`EQ` &operand=`1` &then=`do something` ]] [[!If? &subject=`[[!getUrlParam? &name=
[[!If?
&subject=`[[!getUrlParam? &name=`id`]]`
&operator=`EQ`
&operand=`1`
&then=`do something`
]]
[[!If?
&subject=`[[!getUrlParam? &name=`id`]]`
&operator=`EQ`
&operand=`2`
&then=`do something`
]]
[[!If?
&subject=`[[!getUrlParam? &name=`id`]]`
&operator=`EQ`
&operand=`3`
&then=`do something`
]]
找不到执行此操作的方法。我可以使用此解决方案:
[[If?
&subject=`[[!getUrlParam? &name=`id`]]`
&operator=`inarray`
&operand=`1,2,3`
&then=`do something`
]]
我可以使用此解决方案:
[[If?
&subject=`[[!getUrlParam? &name=`id`]]`
&operator=`inarray`
&operand=`1,2,3`
&then=`do something`
]]
试试额外的
试试额外的