|
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 |
suzie Smarty n00b
Joined: 09 Jul 2003 Posts: 1
|
Posted: Wed Jul 09, 2003 8:39 am Post subject: a = b + 5 in smarty ?????????? |
|
|
to put a variable in an other variable in a template, I know that I can do that :
<{assign var="a" value=$b}>
But it seems impossible to do that :
<{assign var="a" value=($b + 5)}>
what is the right code to make calcul and assign a variable with it (in smarty langage) ? |
|
Back to top |
|
AZTEK Smarty Pro
Joined: 16 Apr 2003 Posts: 235 Location: Purdue University
|
Posted: Wed Jul 09, 2003 10:55 am Post subject: |
|
|
{math assign="a" equation="b+5" b="2"}
though it is highly recommended that you seperate logic and design and not use the math plugin _________________ "Imagine a school with children that can read and write, but with teachers who cannot, and you have a metaphor of the Information Age in which we live." -Peter Cochrane |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Wed Jul 09, 2003 4:00 pm Post subject: |
|
|
Aztek's comments not-withstanding, you may be interested to know that the current CVS implements a patch that adds substantial math support to Smarty.
The plugins forums contains several submitted plugins that you can use with 2.5.0 that provide faster/more convenient math operations. |
|
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
|