Sites Web : SPIP commits - by tech-nova

Publié le lundi 21 avril 2008

⇒ http://my.opera.com/tech-nova/blog/

Un site qui recense les astuces et évolutions des possibilités de SPIP.

[11415] 3 new filters for boolean operators

Avril 2008, par tech-nova

These filters are ’et’, ’ou’, and ’xou’ (for ’and’, ’not’, and ’xor’).
They work like | ?’ ’, :

each filter returns a space char if the condition is verified, elsewhere it returns an empty string

For example this PHP code

if ($a=='testA' OR ($b=='testB' AND $c=='testC')) {echo "OK";}


Can be translated in a template like this :

[(#A|=={testA} 
|ou{[(#B|=={testB}
|et{[(#C|=={testC})]})]}) OK ]


Or better

[(#B|=={testB} 
|et{[(#C|=={testC})] 
|ou{[(#A|=={testA})]}) OK ]

→ Lire la suite sur le site d’origine…


Revenir en haut