[ Index ]
 

Code source de eZ Publish 3.9.0

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/tests/eztemplate/functions/ -> if.tpl (source)

   1  {* if the condition is true, the children should be processed *}
   2  {if 1}
   3  ok1
   4  {/if}
   5  
   6  {* if the condition is true, children of {else} should not be processed *}
   7  {if 1}
   8  ok2
   9  {else}
  10  failed2
  11  {/if}
  12  
  13  {* if the condition is false, children of {else} should be processed *}
  14  {if 0}
  15  failed3
  16  {else}
  17  ok3
  18  {/if}
  19  
  20  {* if the condition is true, children of {else} and {elseif}'s should not be processed *}
  21  {if 1}
  22  ok4
  23  {elseif 1}
  24  failed4
  25  {elseif 1}
  26  failed4
  27  {else}
  28  failed4
  29  {/if}
  30  
  31  {* only children corresponding to the first met true condition should be processed *}
  32  {if 0}
  33  failed5
  34  {elseif 1}
  35  ok5
  36  {elseif 1}
  37  failed5
  38  {else}
  39  failed5
  40  {/if}
  41  
  42  
  43  {if 0}
  44  failed6
  45  {elseif 0}
  46  failed6
  47  {elseif 0}
  48  failed6
  49  {else}
  50  ok6
  51  {/if}
  52  
  53  {* test nesting *}
  54  {if 1}
  55  {if 1}
  56  ok7
  57  {else}
  58  failed7
  59  {/if}
  60  {else}
  61  failed7}
  62  {/if}
  63  
  64  {* test more complex arguments *}
  65  {if 1|not()}
  66  failed8
  67  {else}
  68  ok8
  69  {/if}
  70  
  71  {* test non-constant arguments *}
  72  {def $cond=1}
  73  
  74  {if $cond}
  75  ok9
  76  {else}
  77  failed9
  78  {/if}
  79  {undef $cond}
  80  {* end *}


Généré le : Sat Feb 24 10:30:04 2007 par Balluche grâce à PHPXref 0.7