1{* this template includes a {php} block that assign's the variable $varX *}
2{php}
3 global $foo, $bar;
4 if($foo == $bar){
5 echo 'This will be sent to browser';
6 }
7 // assign a variable to Smarty
8 $this->assign('varX','Toffee');
9{/php}
10{* output the variable *}
11<strong>{$varX}</strong> is my fav ice cream :-)
12
1
2{php}
3 // including a php script directly from the template.
4 include('/path/to/display_weather.php');
5{/php}
6
7