mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-06 11:24:27 +02:00
indentiation
This commit is contained in:
@@ -1,25 +1,24 @@
|
|||||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||||
<!-- $Revision$ -->
|
<!-- $Revision$ -->
|
||||||
<sect1 id="language.variables.smarty">
|
<sect1 id="language.variables.smarty">
|
||||||
<title>{$smarty} reserved variable</title>
|
<title>{$smarty} reserved variable</title>
|
||||||
<para>
|
<para>
|
||||||
The PHP reserved {$smarty} variable can be used to access several
|
The PHP reserved {$smarty} variable can be used to access several
|
||||||
special template variables. The full list of them follows.
|
special template variables. The full list of them follows.
|
||||||
</para>
|
</para>
|
||||||
|
<sect2 id="language.variables.smarty.request">
|
||||||
<sect2 id="language.variables.smarty.request">
|
|
||||||
<title>Request variables</title>
|
<title>Request variables</title>
|
||||||
<para>
|
<para>
|
||||||
The <ulink url="&url.php-manual;reserved.variables">request variables
|
The <ulink url="&url.php-manual;reserved.variables">request variables
|
||||||
</ulink> such as $_GET, $_POST, $_COOKIE, $_SERVER, $_ENV and $_SESSION
|
</ulink> such as $_GET, $_POST, $_COOKIE, $_SERVER, $_ENV and $_SESSION
|
||||||
(see <link linkend="variable.request.vars.order">$request_vars_order</link>
|
(see <link linkend="variable.request.vars.order">$request_vars_order</link>
|
||||||
and <link
|
and <link
|
||||||
linkend="variable.request.use.auto.globals">$request_use_auto_globals</link>
|
linkend="variable.request.use.auto.globals">$request_use_auto_globals</link>
|
||||||
) can be accessed as demonstrated in the examples below:
|
) can be accessed as demonstrated in the examples below:
|
||||||
</para>
|
</para>
|
||||||
<example>
|
<example>
|
||||||
<title>displaying request variables</title>
|
<title>displaying request variables</title>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
{* display value of page from URL (GET) http://www.example.com/index.php?page=foo *}
|
{* display value of page from URL (GET) http://www.example.com/index.php?page=foo *}
|
||||||
{$smarty.get.page}
|
{$smarty.get.page}
|
||||||
@@ -42,116 +41,109 @@
|
|||||||
{* display the variable "username" from merged get/post/cookies/server/env *}
|
{* display the variable "username" from merged get/post/cookies/server/env *}
|
||||||
{$smarty.request.username}
|
{$smarty.request.username}
|
||||||
]]>
|
]]>
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</example>
|
</example>
|
||||||
<note>
|
<note>
|
||||||
<para>
|
<para>
|
||||||
For historical reasons {$SCRIPT_NAME} can be accessed
|
For historical reasons {$SCRIPT_NAME} can be accessed
|
||||||
directly, although {$smarty.server.SCRIPT_NAME} is the
|
directly, although {$smarty.server.SCRIPT_NAME} is the
|
||||||
proposed way to access this value.
|
proposed way to access this value.
|
||||||
</para>
|
</para>
|
||||||
</note>
|
</note>
|
||||||
</sect2>
|
</sect2>
|
||||||
|
<sect2 id="language.variables.smarty.now">
|
||||||
<sect2 id="language.variables.smarty.now">
|
|
||||||
<title>{$smarty.now}</title>
|
<title>{$smarty.now}</title>
|
||||||
<para>
|
<para>
|
||||||
The current <ulink url="&url.php-manual;function.time">timestamp</ulink>
|
The current <ulink url="&url.php-manual;function.time">timestamp</ulink>
|
||||||
can be accessed with {$smarty.now}. The number reflects the number of
|
can be accessed with {$smarty.now}. The number reflects the number of
|
||||||
seconds passed since the so-called Epoch (January 1, 1970)
|
seconds passed since the so-called Epoch (January 1, 1970)
|
||||||
and can be passed directly to the
|
and can be passed directly to the
|
||||||
<link linkend="language.modifier.date.format">date_format</link>
|
<link linkend="language.modifier.date.format">date_format</link>
|
||||||
modifier for display purposes.
|
modifier for display purposes.
|
||||||
</para>
|
</para>
|
||||||
<example>
|
<example>
|
||||||
<title>using {$smarty.now}</title>
|
<title>using {$smarty.now}</title>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
{* use the date_format modifier to show current date and time *}
|
{* use the date_format modifier to show current date and time *}
|
||||||
{$smarty.now|date_format:"%Y-%m-%d %H:%M:%S"}
|
{$smarty.now|date_format:"%Y-%m-%d %H:%M:%S"}
|
||||||
]]>
|
]]>
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</example>
|
</example>
|
||||||
</sect2>
|
</sect2>
|
||||||
<sect2 id="language.variables.smarty.const">
|
<sect2 id="language.variables.smarty.const">
|
||||||
<title>{$smarty.const}</title>
|
<title>{$smarty.const}</title>
|
||||||
<para>
|
<para>
|
||||||
You can access PHP constant values directly.
|
You can access PHP constant values directly. See also <link
|
||||||
See also <link
|
linkend="smarty.constants">smarty constants</link>
|
||||||
linkend="smarty.constants">smarty constants</link>
|
</para>
|
||||||
</para>
|
<example>
|
||||||
<example>
|
<title>using {$smarty.const}</title>
|
||||||
<title>using {$smarty.const}</title>
|
<programlisting>
|
||||||
<programlisting>
|
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
{$smarty.const._MY_CONST_VAL}
|
{$smarty.const._MY_CONST_VAL}
|
||||||
]]>
|
]]>
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</example>
|
</example>
|
||||||
</sect2>
|
</sect2>
|
||||||
|
|
||||||
<sect2 id="language.variables.smarty.capture">
|
|
||||||
<title>{$smarty.capture}</title>
|
|
||||||
<para>
|
|
||||||
The output captured via
|
|
||||||
<link linkend="language.function.capture">{capture}..{/capture}</link>
|
|
||||||
construct can be
|
|
||||||
accessed using {$smarty} variable. See section on
|
|
||||||
<link linkend="language.function.capture">{capture}</link> for an example.
|
|
||||||
</para>
|
|
||||||
</sect2>
|
|
||||||
|
|
||||||
<sect2 id="language.variables.smarty.config">
|
|
||||||
<title>{$smarty.config}</title>
|
|
||||||
<para>
|
|
||||||
{$smarty} variable can be used to refer to loaded
|
|
||||||
<link
|
|
||||||
linkend="language.config.variables">config variables</link>.
|
|
||||||
{$smarty.config.foo} is a synonym for {#foo#}. See the section on
|
|
||||||
<link
|
|
||||||
linkend="language.function.config.load">{config_load}</link> for an example.
|
|
||||||
</para>
|
|
||||||
</sect2>
|
|
||||||
|
|
||||||
<sect2 id="language.variables.smarty.loops">
|
|
||||||
<title>{$smarty.section}, {$smarty.foreach}</title>
|
|
||||||
<para>
|
|
||||||
{$smarty} variable can be used to refer to
|
|
||||||
<link linkend="language.function.section">{section}</link> and
|
|
||||||
<link linkend="language.function.foreach">{foreach}</link>
|
|
||||||
loop properties.
|
|
||||||
</para>
|
|
||||||
</sect2>
|
|
||||||
|
|
||||||
<sect2 id="language.variables.smarty.template">
|
|
||||||
<title>{$smarty.template}</title>
|
|
||||||
<para>
|
|
||||||
This variable contains the name of the current template being
|
|
||||||
processed.
|
|
||||||
</para>
|
|
||||||
</sect2>
|
|
||||||
<sect2 id="language.variables.smarty.version">
|
|
||||||
<title>{$smarty.version}</title>
|
|
||||||
<para>
|
|
||||||
This variable contains the version of Smarty the template was compiled with.
|
|
||||||
</para>
|
|
||||||
</sect2>
|
|
||||||
<sect2 id="language.variables.smarty.ldelim">
|
|
||||||
<title>{$smarty.ldelim}, {$smarty.rdelim}</title>
|
|
||||||
<para>
|
|
||||||
This variable is used for printing the left-delimiter and right-delimiter value literally.
|
|
||||||
See <link linkend="language.function.ldelim">{ldelim},{rdelim}</link>.
|
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
See also
|
|
||||||
<link linkend="language.syntax.variables">Variables</link> and
|
|
||||||
<link linkend="language.config.variables">Config Variables</link>
|
|
||||||
</para>
|
|
||||||
</sect2>
|
|
||||||
|
|
||||||
|
<sect2 id="language.variables.smarty.capture">
|
||||||
|
<title>{$smarty.capture}</title>
|
||||||
|
<para>
|
||||||
|
The output captured via <link
|
||||||
|
linkend="language.function.capture">{capture}..{/capture}</link>
|
||||||
|
construct can be accessed using {$smarty} variable. See section on
|
||||||
|
<link linkend="language.function.capture">{capture}</link> for an
|
||||||
|
example.
|
||||||
|
</para>
|
||||||
|
</sect2>
|
||||||
|
|
||||||
|
<sect2 id="language.variables.smarty.config">
|
||||||
|
<title>{$smarty.config}</title>
|
||||||
|
<para>
|
||||||
|
{$smarty} variable can be used to refer to loaded <link
|
||||||
|
linkend="language.config.variables">config variables</link>.
|
||||||
|
{$smarty.config.foo} is a synonym for {#foo#}. See the section on
|
||||||
|
<link linkend="language.function.config.load">{config_load}</link>
|
||||||
|
for an example.
|
||||||
|
</para>
|
||||||
|
</sect2>
|
||||||
|
|
||||||
|
<sect2 id="language.variables.smarty.loops">
|
||||||
|
<title>{$smarty.section}, {$smarty.foreach}</title>
|
||||||
|
<para>
|
||||||
|
{$smarty} variable can be used to refer to
|
||||||
|
<link linkend="language.function.section">{section}</link> and
|
||||||
|
<link linkend="language.function.foreach">{foreach}</link>
|
||||||
|
loop properties.
|
||||||
|
</para>
|
||||||
|
</sect2>
|
||||||
|
|
||||||
|
<sect2 id="language.variables.smarty.template">
|
||||||
|
<title>{$smarty.template}</title>
|
||||||
|
<para>
|
||||||
|
This variable contains the name of the current template being
|
||||||
|
processed.
|
||||||
|
</para>
|
||||||
|
</sect2>
|
||||||
|
<sect2 id="language.variables.smarty.version">
|
||||||
|
<title>{$smarty.version}</title>
|
||||||
|
<para>
|
||||||
|
This variable contains the version of Smarty the template was compiled with.
|
||||||
|
</para>
|
||||||
|
</sect2>
|
||||||
|
<sect2 id="language.variables.smarty.ldelim">
|
||||||
|
<title>{$smarty.ldelim}, {$smarty.rdelim}</title>
|
||||||
|
<para>
|
||||||
|
This variable is used for printing the left-delimiter and right-delimiter value literally.
|
||||||
|
See <link linkend="language.function.ldelim">{ldelim},{rdelim}</link>.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
See also
|
||||||
|
<link linkend="language.syntax.variables">Variables</link> and
|
||||||
|
<link linkend="language.config.variables">Config Variables</link>
|
||||||
|
</para>
|
||||||
|
</sect2>
|
||||||
</sect1>
|
</sect1>
|
||||||
<!-- Keep this comment at the end of the file
|
<!-- Keep this comment at the end of the file
|
||||||
Local variables:
|
Local variables:
|
||||||
@@ -173,5 +165,3 @@ vim600: syn=xml fen fdm=syntax fdl=2 si
|
|||||||
vim: et tw=78 syn=sgml
|
vim: et tw=78 syn=sgml
|
||||||
vi: ts=1 sw=1
|
vi: ts=1 sw=1
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user