Http://blog.sina.com.cn/s/blog_6721f25c01011qdj.html
The main thing is to pay the value of the program inside the template, because when using smarty, there is no PHP code inside the template, can not display the value of the variables generated during the operation process, so you can use a function of PHP inside the value of the smarty, so that in the template display
For example:
If I want to display the value of a variable on a page, such as
$ABC = "This is the value of a variable";
then I use Smarty's assign () function in the program as follows:
$smarty->assign ("AAA", $ABC);
at this point, in the Smarty class there will be a variable AAA containing the value of $ABC, so that in the template can be like the following way to show his value
the value of the variable is: {$AAA}
Note:
(1) If there is {} in the code of the HTML, {literal}{/literal} must be added in the middle of the html{} in order to display properly.
(2) PHP debugging in Linux can be used: PHP xxx.php so that the error message can be displayed.
Smarty's assign () function