Board logo

标题: smarty 数学运算 [打印本页]

作者: fangzhen    时间: 2011-1-29 21:48     标题: smarty 数学运算

Math can be applied directly to variable values.

数学运算可以直接应用到变量

{$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`"}






欢迎光临 PHP开发笔记 (http://phpvi.com/) Powered by Discuz! 6.1.0