Bonjour à tous,
dans ma grande aventure SF2, je me suis récemment attaqué aux constantes.
J'aurai besoin de tester si une constante est définie si oui, je l'utilise, sinon, je prends une valeur par défaut.
Voici ce que j'ai essayé :
Code:
1
2 {%if constant(('maConstante')) is defined%}
Citation:
The "defined" test only works with simple variables
Code:
1
2 {%if constant(('maConstante')) is not none%}
Si quelqu'un a la solution, je suis preneur.Citation:
An exception has been thrown during the rendering of a template ("Warning: constant(): Couldn't find constant
Thx