mirror of
https://github.com/smarty-php/smarty.git
synced 2025-11-11 17:43:50 +01:00
172 lines
5.2 KiB
XML
172 lines
5.2 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 1.11 Maintainer: andreas Status: ready -->
|
|
<sect1 id="language.variables.smarty">
|
|
<title>Die reservierte {$smarty} Variable</title>
|
|
<para>
|
|
Die reservierte Variable {$smarty} wird verwendet, um auf spezielle
|
|
Template-Variablen zuzugreifen. Im Folgenden die Liste der
|
|
Variablen:
|
|
</para>
|
|
<sect2 id="language.variables.smarty.request">
|
|
<title>Request-Variablen</title>
|
|
<para>
|
|
|
|
Aud die <ulink
|
|
url="&url.php-manual;reserved.variables">Request-Variablen </ulink>
|
|
$_GET, $_POST, $_COOKIE, $_SERVER, $_ENV and $_SESSION (siehe <link
|
|
linkend="variable.request.vars.order">$request_vars_order</link>
|
|
und <link
|
|
linkend="variable.request.use.auto.globals">$request_use_auto_globals</link>
|
|
) kann wie folgt zugegriffen werden.
|
|
</para>
|
|
<example>
|
|
<title>Ausgabe der Requestvariablen (Anfragevariablen)</title>
|
|
<programlisting>
|
|
{* anzeigen der variable 'page' aus der URL oder dem FORM, welche mit GET übertragen wurde *}
|
|
{$smarty.get.page}
|
|
|
|
{* anzeigen der variable 'page' welche mit POST übertragen wurde *}
|
|
{$smarty.post.page}
|
|
|
|
{* anzeigen des cookies "benutzer" *}
|
|
{$smarty.cookies.benutzer}
|
|
|
|
{* anzeigen der Server-Variable "SERVER_NAME" *}
|
|
{$smarty.server.SERVER_NAME}
|
|
|
|
{* anzeigen der Environment-Variable "PATH" *}
|
|
{$smarty.env.PATH}
|
|
|
|
{* anzeigen der Session-Variable "id" *}
|
|
{$smarty.session.id}
|
|
|
|
{* anzeigen der Variable "benutzer" aus dem $_REQUEST Array (Zusammenstellung von get/post/cookie/server/env) *}
|
|
{$smarty.request.benutzer}
|
|
</programlisting>
|
|
</example>
|
|
<note>
|
|
<para>
|
|
Aus historischen Gründen kann {$SCRIPT_NAME} verwendet werden,
|
|
allerdings ist {$smarty.server.SCRIPT_NAME} die empfohlene
|
|
Variante.
|
|
</para>
|
|
</note>
|
|
</sect2>
|
|
<sect2 id="language.variables.smarty.now">
|
|
<title>{$smarty.now}</title>
|
|
<para>
|
|
Die momentane Unix-Timestamp kann über {$smarty.now} angefragt
|
|
werden. Diese Zahl ist die Summe der verstrichenen Sekunden seit
|
|
Beginn der UNIX-Epoche (1. Januar 1970) und kann zur Anzeige
|
|
direkt dem <link
|
|
linkend="language.modifier.date.format">'date_format'-Modifikator
|
|
</link> übergeben werden.
|
|
</para>
|
|
<example>
|
|
<title>Verwendung von {$smarty.now}</title>
|
|
<programlisting>
|
|
<![CDATA[
|
|
{* Verwendung des 'date_format'-Modifikators zur Anzeige der Zeit *}
|
|
{$smarty.now|date_format:"%Y-%m-%d %H:%M:%S"}
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</sect2>
|
|
<sect2 id="language.variables.smarty.const">
|
|
<title>{$smarty.const}</title>
|
|
<para>
|
|
Hiermit kann auf PHP-Konstanten zugegriffen werden. Siehe auch <link
|
|
linkend="smarty.constants">smarty constants</link>
|
|
</para>
|
|
<example>
|
|
<title>Benutzung von {$smarty.const}</title>
|
|
<programlisting>
|
|
<![CDATA[
|
|
{$smarty.const._MY_CONST_VAL}
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</sect2>
|
|
<sect2 id="language.variables.smarty.capture">
|
|
<title>{$smarty.capture}</title>
|
|
<para>
|
|
Auf die mit dem <link
|
|
linkend="language.function.capture">{capture}..{/capture}</link>
|
|
Konstrukt abgefangene Ausgabe kann via {$smarty} zugegriffen
|
|
werden. Ein Beispiel dazu finden Sie im Abschnitt zu <link
|
|
linkend="language.function.capture">capture</link>.
|
|
</para>
|
|
</sect2>
|
|
|
|
<sect2 id="language.variables.smarty.config">
|
|
<title>{$smarty.config}</title>
|
|
<para>
|
|
{$smarty} kann dazu genutzt werde, um auf <link
|
|
linkend="language.config.variables">Config-Variablen</link>
|
|
zuzugreifen. {$smarty.config.foo} ist ein Synonym for {#foo#}. Im
|
|
Abschnitt <link
|
|
linkend="language.function.config.load">{config_load}</link> ist
|
|
ein Beispiel.
|
|
</para>
|
|
</sect2>
|
|
<sect2 id="language.variables.smarty.loops">
|
|
<title>{$smarty.section}, {$smarty.foreach}</title>
|
|
<para>
|
|
{$smarty} wird auch verwendet, um auf Eigenschaften von <link
|
|
linkend="language.function.section">{section}</link> und <link
|
|
linkend="language.function.foreach">foreach</link> Schleifen
|
|
zuzugreifen.
|
|
</para>
|
|
</sect2>
|
|
|
|
<sect2 id="language.variables.smarty.template">
|
|
<title>{$smarty.template}</title>
|
|
<para>
|
|
Diese Variable enthält den Namen des gerade verarbeiteten
|
|
Templates.
|
|
</para>
|
|
</sect2>
|
|
|
|
<sect2 id="language.variables.smarty.version">
|
|
<title>{$smarty.version}</title>
|
|
<para>
|
|
Diese Variable enthält die Smarty Versionsnummer mit der das
|
|
Template kompiliert wurde.
|
|
</para>
|
|
</sect2>
|
|
<sect2 id="language.variables.smarty.ldelim">
|
|
<title>{$smarty.ldelim}, {$smarty.rdelim}</title>
|
|
<para>
|
|
Diese Variablen dienen dazu den linken und rechten Trennzeichen
|
|
wortwörtlich auszugeben. Siehe auch <link
|
|
linkend="language.function.ldelim">{ldelim},{rdelim}</link>.
|
|
</para>
|
|
<para>
|
|
Siehe auch:
|
|
<link linkend="language.syntax.variables">Variables</link> and
|
|
<link linkend="language.config.variables">Config Variables</link>
|
|
</para>
|
|
</sect2>
|
|
</sect1>
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"../../../../manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|