There are multiple types of php template engine smarty variables. different types of variables are differentiated by their prefix. If you want to output a variable, you can enclose it with a delimiter. there are multiple types of variables in the php template engine smarty, and different types of variables are differentiated by their prefix.
If you want to output a variable, you can enclose it with a delimiter, for example:
{$ Name}
{$ Contacts [row]. Phone}
Type 1: The variables allocated from PHP and The assign function in the template must be preceded by the "$" symbol. (more common, the instance can refer to the above code) Type 2: variables read from the configuration file or smarty variables ($ smarty. config), which is included in "#" when displayed. code instance:
Foo. conf configuration file
PageTitle = "cn-web.com demo"
BodyBgColor = "# eeeeee"
TableBorderSize = "3"
TableBgColor = "# bbbbbb"
RowBgColor? "# Cccccc"
Index. tpl File (call method 1)
{Config_load file = "foo. conf "}
{# PageTitle #}
Index. tpl: (alternate syntax) call method 2
{Config_load file = "foo. conf "}
{$ Smarty. config. pageTitle}
OUTPUT: (the OUTPUT results of the two examples are the same)
This is mine
Configuration file variables are used only when they are loaded.
Type 3: reserved variables
{$ Smarty. variable} reserved variables can be used to access some special template variables.
For example:
Request variables [page Request variable]
{$ Smarty. now}
{$ Smarty. const}
{$ Smarty. capture}
{$ Smarty. config}
{$ Smarty. section}, {$ smarty. foreach}
{$ Smarty. template}