views:

74

answers:

2

Hy i have this code.

{if $isModerator && $order->kind==1}
bla bla
{/if}

and $order->kind can be 1,2,3,4,6 so making 5 if is not the idea any idea?

A: 

Smarty has a for or while cycle? You could always cycle on that like in pseudocode here:

for($i=0;$i>max($order->kind);$i++){
  if($isModerator and $order->kind==$i){
    //code here
  }
}
Lex
+1  A: 

Wouldn't this work for you?

{if $isModerator && in_array($order->kind, array(1,2,3,4,5))}
bla bla
{/if}

Haven't used Smarty for quite a while now, so not sure.

Michal M
Thanky you very much this worked for me. Have a nice day :-)
streetparade