Smarty has several different types of variables.
The type of the variable depends on what symbol it is prefixed with (or enclosed
within).
Smarty有一些不同种类的变量.
变量 的类型取决于它的前缀是什么符号(或者内附)
Variables in Smarty can be either displayed directly or used as arguments for
function attributes and modifiers, inside conditional expressions, etc.
To print a variable, simply enclose it in the delimiters so that it is the
only thing contained between them. Examples:
Smarty的变量可以直接被输出或者作为函数属性和调节器的参数,或者用于内部的条件表达式等等.
如果要输出一个变量,简单的用定界符将它括起来就可以.例如:
{$Name} {$Contacts[row].Phone} <body bgcolor="{#bgcolor#}"> |
Variables that are assigned from PHP are referenced by preceding them with a
dollar sign $.
Variables assigned from within the template with the assign function are also displayed this way.
从PHP分配的变量带"$"符号.
模板内的assign函数分配的变量也是这样显示的.