Home >Backend Development >PHP Tutorial >Usage of get, post, request, cookies, and session variables in smarty templates

Usage of get, post, request, cookies, and session variables in smarty templates

WBOY
WBOYOriginal
2016-07-25 08:53:251165browse
  1. {$smarty.now|date_format:"%Y-%m-%d %H:%M:%S"}
Copy code

2.{$smarty.const} PHP constants can be accessed directly. For example

  1. {$smarty.const._MY_CONST_VAL}
Copy code

3.{$smarty.capture} The output captured through the {capture}..{/capture} structure can be accessed using the {$smarty} variable.

4.{$smarty.config} {$smarty} variables can access loaded config variables For example {$smarty.config.foo} can represent {#foo#}

5.{$smarty.section}, {$smarty.foreach} {$smarty} variables can access properties of 'section' and 'foreach' loops

6.{$smarty.template} displays the name of the currently processed template

7.{$smarty.version} Show smarty template version 8.{$smarty.ldelim} displays the left delimiter 9.{$smarty.rdelim} displays the right delimiter



Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn