Re: [SMARTY] Smarty - Math

From: Date: Sat, 25 Oct 2003 20:18:47 +0000
Subject: Re: [SMARTY] Smarty - Math
References: 1 2  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-10425@lists.php.net to get a copy of this message
Thank you for pointing that out. For those interested, here is what I did to work around this: {math equation="x + y" x=$widgets[t][0].spot y=1} Based on what I've read, I would not recommend doing this because it would be slower then just add-ing in php code and then assigning a new variable to smarty. messju mohr <messju@lammfellpuschen.de> wrote: > On Sat, Oct 25, 2003 at 03:26:57PM -0400, Jason Hubble wrote: > > I need to be able to add two numbers togher in a template but it doesn't > seem > > to be working. > > the math-operators are only available since > Smarty-2.6.0. unfortunately, the manual is missing this notice. > > try Smarty-2.6.0-RC2 if you dare or use the {math}-plugin which works > with 2.5.0 and older. > > greetings > messju > > > Here is the error I get: > > Fatal error: Smarty: [in edit_layout.html line 9]: syntax error: > unrecognized > > tag: $foo*1 (Smarty_Compiler.class.php, line 382) in > > /usr/local/lib/php/Smarty_Compiler.class.php on line 1824 > > > > it would be the same error if I tried to add one except where it says $foo*1 > > it would say $foo+1. > > > > > > Here is the document that makes me think what I'm doing should work: > > http://smarty.php.net/manual/en/language.math.php > > > > Here is what I typed in looks like in the template: > > {$foo*1} > > > > Thanks for your help! > > > > jason > > > > > > > > -- > > Smarty General Mailing List (http://smarty.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.smarty.general (#10425) next »