smarty template engine
Friday, May 16, 2008  
download | documentation | faq | forum | mailing lists | changelog | contribs 


search for in the  


Math

Math can be applied directly to variable values.

Example 3-7. math examples

{$foo+1}

{$foo*$bar}

{* some more complicated examples *}

{$foo->bar-$bar[1]*$baz->foo->bar()-3*7}

{if ($foo+$bar.test%$baz*134232+10+$b+10)}

{$foo|truncate:"`$fooTruncCount/$barTruncFactor-1`"}

{assign var="foo" value="`$foo+$bar`"}

See also the {math} function for complex equations and {eval}.




 

credits 

Smarty Copyright © 2002-2008 New Digital Group, Inc.
All rights reserved.
Last updated: Tue Feb 12 09:11:23 2008 CST