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 und math???

 
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: German
View previous topic :: View next topic  
Author Message
pxlArtizzt
Smarty Rookie


Joined: 09 Aug 2004
Posts: 13

PostPosted: Mon Aug 16, 2004 9:24 am    Post subject: if und math??? Reply with quote

Hallo,

wie kann ich eine if-Abfrage mit einer math-equation erstellen? Beispiel:

{if math equation="x + y + 1" x=$start y=$offset >= $anzahl} bla {/if}

ich bekomme da nur einen Fatal error... =(
Back to top
View user's profile Send private message Visit poster's website
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Mon Aug 16, 2004 9:55 am    Post subject: Reply with quote

wieso {math} ?

Code:
{if $start+$offset+1 >= $anzahl} bla {/if}

sollte tun.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
pxlArtizzt
Smarty Rookie


Joined: 09 Aug 2004
Posts: 13

PostPosted: Mon Aug 16, 2004 10:30 am    Post subject: Reply with quote

wow, funktioniert! Danke für die schnelle Antwort =)

Ich wusste halt nicht, dass man math nicht nehmen muss... Wink
Back to top
View user's profile Send private message Visit poster's website
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Mon Aug 16, 2004 10:42 am    Post subject: Reply with quote

übrigens: wenn du math nehmen musst (weil der ausdruck zu kompliziert für's {if} ist, und {if} nur simple-math kann), dann müsstest du über das assign-attribut gehen:

{match equation="komplizierter vergleich" x=.. y=.. assign=tmp_var}{if $tmp_var} ... {/if}
Back to top
View user's profile Send private message Send e-mail Visit poster's website
pxlArtizzt
Smarty Rookie


Joined: 09 Aug 2004
Posts: 13

PostPosted: Mon Aug 16, 2004 10:43 am    Post subject: Reply with quote

aaaah Very Happy man lernt nie aus! thx!!
Back to top
View user's profile Send private message Visit poster's website
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: German 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