Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

if exist ou empty ??

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: French
View previous topic :: View next topic  
Author Message
ZIG1
Smarty Rookie


Joined: 09 Feb 2006
Posts: 21
Location: Paris, France

PostPosted: Thu Feb 09, 2006 11:52 am    Post subject: if exist ou empty ?? Reply with quote

Bonjour,

je suis nouvelle, j'apprend smarty depuis hier ...
Et c'est ma première en poo ...

Bref c'est pas gagné ...

J'arrive a faire un certain nombre de chose, mais je ne sais pas tester si une variable est là ou pas dans un template.
En php j'aurais fait empty () ??? mais là ...
J'ai cherché sur la documentation ... et je ne trouve pas mais je ne sais pas dans case ils auraient pu le mettre.

Voilà merci d'avance pour votre aide
_________________
...:::ZIG1:::...
Back to top
View user's profile Send private message
demental
Smarty Rookie


Joined: 11 Jan 2006
Posts: 20
Location: Lost in the French deeeeep countryside

PostPosted: Thu Feb 09, 2006 6:47 pm    Post subject: Reply with quote

Code:

{if $mavariable}
faire un truc si mavariable est initialisée (ou pas false)
{/if}

ou

Code:

{if $mavariable ne ''}
faire un truc si mavariable est initialisée (ou pas vide)
{/if}
Back to top
View user's profile Send private message Visit poster's website
jbenzakin
Smarty Rookie


Joined: 09 Nov 2006
Posts: 6
Location: austin

PostPosted: Tue Dec 19, 2006 11:00 pm    Post subject: testez Reply with quote

{if $page eq index} //eq == equal (egale)
//fais quelque chose
{else}
//fais quelque chose d'autre
{/if}


ou tu peut faire {if $page ne index} //ne == not equal (pas egale)

tu peut aussi faire:
{if $page ne index && $page ne contact}
//fais quelque chose
{/if}
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
ciboulette
Smarty Regular


Joined: 13 Jul 2006
Posts: 45

PostPosted: Wed Dec 20, 2006 12:21 am    Post subject: Reply with quote

les 2 monsieur on raison pour moi un {if $mavariable} es largement suffisant dans la plupar des cas , mainenant n'oublie pas que smarty est la pour dissocié le code de l'affichage surtout , essaye avant de reflechire si php ne peu pas faire se que tu demande a smarty, si tu boss avec un webdesigner qui n'est pas forcement doué en dev ça lui facilitera la tache et a toi aussi en cas de mise a jours graphique.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: French All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP