Variable Source:
1. Use assign to allocate the variables allocated from php.
2. System Variables
3. Path replacement variable
Function variables cannot be used.
Variable output shortcut label
{@ Var} // The output Session variable is equivalent to {$ Think. session. var }.
{# Var} // The Cookie output variable is equivalent to {$ Think. cookie. var }.
{& Var} // The output configuration parameter is equivalent to {$ Think. config. var }.
{% Var} // The output language variable is equivalent to {$ Think. lang. var }.
{. Var} // The output Get variable is equivalent to {$ Think. get. var }.
{^ Var} // The output POST variable is equivalent to {$ Think. post. var }.
{* Var} // The output constant is equivalent to {$ Think. const. var }.
{@ Var1.var2} // output $ _ SESSION ['var1'] ['var2']
{# Var1.var2} // output $ _ COOKIE ['var1'] ['var2']
Convert to uppercase {$ title | strtoupper}
The function call format of template variables is:
Copy codeThe Code is as follows:
{$ Varname | function1 | function2 = arg1, arg2 ,###}
Note:
{There is no space between the symbol and the $ symbol, and there is no problem with the space of the following parameter ### it indicates that the parameter location of the template variable itself supports multiple functions, and the space between functions supports the function shielding function, in the configuration file, you can configure the disabled function list to support variable caching. Repeated variable strings are parsed several times.
Example: X
Copy codeThe Code is as follows:
{$ WebTitle | md5 | strtoupper | substr = 0, 3}