Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 148 | Details | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
991 lars 1
# Math
148 lars 2
 
3
Math can be applied directly to variable values.
4
 
991 lars 5
## Examples
6
```smarty
7
{$foo+1}
148 lars 8
 
991 lars 9
{$foo*$bar}
148 lars 10
 
991 lars 11
{* some more complicated examples *}
148 lars 12
 
991 lars 13
{$foo->bar-$bar[1]*$baz->foo->bar()-3*7}
148 lars 14
 
991 lars 15
{if ($foo+$bar.test%$baz*134232+10+$b+10)}
148 lars 16
 
991 lars 17
{$foo|truncate:"`$fooTruncCount/$barTruncFactor-1`"}
148 lars 18
 
991 lars 19
{assign var="foo" value="`$foo+$bar`"}
20
```
148 lars 21
 
22
> **Note**
23
>
24
> Although Smarty can handle some very complex expressions and syntax,
25
> it is a good rule of thumb to keep the template syntax minimal and
26
> focused on presentation. If you find your template syntax getting too
27
> complex, it may be a good idea to move the bits that do not deal
28
> explicitly with presentation to PHP by way of plugins or modifiers.