What is Smarty?
Why use it?
Use Cases and Work Flow
Syntax Comparison
Template Inheritance
Best Practices
Crash Course
You may use the Smarty logo according to the trademark notice.
For sponsorship, advertising, news or other inquiries, contact us at:
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}
.