Summary of pre-reserved variables for PHP smarty

Source: Internet
Author: User
Tags smarty template
The following are examples of accessing 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} Gets the system environment variable PATH, {$smarty. Request.username} gets get/post/ The compound variable of the cookies/server/env.
{$smarty. Now} variable is used to access the current timestamp.
The output can be formatted with the Date_format regulator. For example {$smarty. Now|date_format: "%y-%m-%d%h:%m:%s"}
{$smarty. Const}
You can access PHP constants directly. For example {$smarty. Const._my_const_val}
{$smarty. Capture}
You can pass {capture}. The output of the {/CAPTURE} structure interception can be accessed using the {$smarty} variable.
{$smarty. config}
The {$smarty} variable can access the config variable that has already been loaded.
For example {$smarty. Config.foo} can represent {#foo #}.
{$smarty. Section}, {$smarty. foreach}
{$smarty} variables can access the properties of the ' section ' and ' foreach ' loops.
{$smarty. Template}
Displays the name of the template that is currently being processed.
{$smarty. Version}
Displays the version of the Smarty template
{$smarty. Ldelim}
Show left delimiter
{$smarty. Rdelim}
Show Right delimiter

The above describes the PHP smarty pre-reserved variable summary, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.

  • Related Article

    Contact Us

    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.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.