Variables: $smarty reserved variable

Variabel bawaan PHP {$smarty} dapat digunakan untuk mengakses beberapa variabel environment dan variabel request Berikut daftar lengkapnya.

Variabel Sistem PHP
Variabel Sistem PHP seperti $_GET, $_POST, $_COOKIE, $_SERVER, $_ENV, dan $_SESSION dapat diakses seperti yang ditunjukkan pada contoh di bawah ini:

Note

For historical reasons {$SCRIPT_NAME} is short-hand for {$smarty.server.SCRIPT_NAME}.

Note Although Smarty provides direct access to PHP super globals for convenience, it should be used with caution. Directly accessing super globals mixes underlying application code structure with templates. A good practice is to assign specific needed values to template vars.

{$smarty.now}
The current timestamp can be accessed with {$smarty.now}. The value reflects the number of seconds passed since the so-called Epoch on January 1, 1970, and can be passed directly to the date_format modifier for display. Note that time is called on each invocation; eg a script that takes three seconds to execute with a call to $smarty.now at start and end will show the three second difference.

{$smarty.const}
You can access PHP constant values directly. See also smarty constants.

Output the constant in a template with

Note

Although Smarty provides direct access to PHP constants for convenience, it is typically avoided as this is mixing underlying application code structure into the templates. A good practice is to assign specific needed values to template vars.

{$smarty.capture}
Template output captured via the built-in {capture}..{/capture} function can be accessed using the {$smarty.capture} variable. See the {capture} page for more information.

{$smarty.config}
{$smarty.config} variable can be used to refer to loaded config variables. {$smarty.config.foo} is a synonym for {#foo#}. See the {config_load} page for more info.

{$smarty.section}
The {$smarty.section} variables can be used to refer to {section} loop properties. These have some very useful values such as .first, .index, etc.

Note

The {$smarty.foreach} variable is no longer used with the new {foreach} syntax, but is still supported with Smarty 2.x style foreach syntax.

{$smarty.template}
Returns the name of the current template being processed (without the directory).

{$smarty.template_object}
Returns the template object of the current template being processed.

{$smarty.current_dir}
Returns the name of the directory for the current template being processed.

{$smarty.version}
Returns the version of Smarty the template was compiled with.

{$smarty.block.child}
Returns block text from child template. See Template interitance.

{$smarty.block.parent}
Returns block text from parent template. See Template interitance

{$smarty.ldelim}, {$smarty.rdelim}
These variables are used for printing the left-delimiter and right-delimiter value literally, the same as {ldelim},{rdelim}.

Sumber
https://www.smarty.net/docs/en/language.variables.smarty.tpl