Smarty Icon

You may use the Smarty logo according to the trademark notice.

Smarty Template Engine Smarty Template Engine

For sponsorship, advertising, news or other inquiries, contact us at:

Sites Using Smarty

Advertisement

Opérations mathématiques

Les opérations mathématiques peuvent être directement appliquées aux variables.

Example 3.7. Exemples d'opérations mathématiques


{$foo+1}

{$foo*$bar}

{* quelques exemples plus compliqués *}

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

  

Voir aussi la fonction {math} pour les équations complexes et {eval}.