Note
在Smarty 3.1,{php}
仅在SmartyBC中可用。
Example 7.61. {php}标签的使用
- {* this template includes a {php} block that assign's the variable $varX *}
- {php}
- if($foo == $bar){
- echo 'This will be sent to browser';
- }
- // assign a variable to Smarty
- {/php}
- {* output the variable *}
- <strong>{$varX}</strong> is my fav ice cream :-)
参见 , , , 和 组件化模板.