The reserved variable {$ smarty} can be used to access some special template variables. The following are all the page request variables. The following are examples of access page request variables such as get, post, cookies, server, enviroment, and session variables. for example, {$ smarty. server. SERVER_NAME} gets the server variable, {$ smarty. env. PATH} obtains the path of the system environment variable {$ smarty. request. username} obtains the compound variable of get/post/cookies/server/env.
The variable {$ smarty. now} is used to access the current timestamp.
You can use the date_format regulator to format the output. for example, {$ smarty. now | date_format: "% Y-% m-% d % H: % M: % S "}
{$ Smarty. const}
You can directly access PHP constants. for example, {$ smarty. const. _ MY_CONST_VAL}
{$ Smarty. capture}
You can use the {$ smarty} variable to access the output captured by the {capture}... {/capture} structure.
{$ Smarty. config}
The variable {$ smarty} can access the loaded config variable.
For example, {$ smarty. config. foo} indicates {# foo #}.
{$ Smarty. section}, {$ smarty. foreach}
The {$ smarty} variable can be used to access the attributes of the 'core' and 'foreach' loops.
{$ Smarty. template}
Displays the name of the currently processed template.
{$ Smarty. version}
Display the version of the smarty Template
{$ Smarty. ldelim}
Show left separator
{$ Smarty. rdelim}
Show right separator
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.