|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
pxlArtizzt Smarty Rookie
Joined: 09 Aug 2004 Posts: 13
|
Posted: Mon Aug 16, 2004 9:24 am Post subject: if und math??? |
|
|
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 |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Mon Aug 16, 2004 9:55 am Post subject: |
|
|
wieso {math} ?
Code: | {if $start+$offset+1 >= $anzahl} bla {/if} |
sollte tun. |
|
Back to top |
|
pxlArtizzt Smarty Rookie
Joined: 09 Aug 2004 Posts: 13
|
Posted: Mon Aug 16, 2004 10:30 am Post subject: |
|
|
wow, funktioniert! Danke für die schnelle Antwort =)
Ich wusste halt nicht, dass man math nicht nehmen muss... |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Mon Aug 16, 2004 10:42 am Post subject: |
|
|
ü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 |
|
pxlArtizzt Smarty Rookie
Joined: 09 Aug 2004 Posts: 13
|
Posted: Mon Aug 16, 2004 10:43 am Post subject: |
|
|
aaaah man lernt nie aus! thx!! |
|
Back to top |
|
|
|
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
|