Re: [SMARTY-DEV] simple math
| From: | boots | Date: | Fri, 02 May 2003 21:54:50 +0000 |
| Subject: | Re: [SMARTY-DEV] simple math | ||
| Groups: | php.smarty.dev | ||
| Request: | Send a blank email to php-smarty-dev+get-1326@lists.php.net to get a copy of this message | ||
Boots:
>> ie. $var+1 <== no math
>> ($var+1) <== math allowed
Monte:
>Sounds doable, but that adds yet another syntax to the template. :(
Its not so bad :) It means precedence can be delcared and that you can
nest expressions. It also means that some existing templates (written
without considering math support) don't get broken.
a contrived example:
{include file="$my_dir/1/$my_file"} (not sure if this will break)
also: (this will break)
{assign var=looks value="10"}
{assign var=output value="$looks++"}
I wonder if a modifier is a better choice to implement this
functionality. The modifier expects to get an expression (that it can
eval). Or do they only operate at runtime? In that case, a compile-time
modifier :)
__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com