mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-06 11:24:27 +02:00
sync with en
This commit is contained in:
@@ -1,40 +1,45 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.2 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.syntax.attributes">
|
||||
<title>Attribute / Parameter</title>
|
||||
<para>
|
||||
Die meisten Funktionen nehmen Parameter entgegen, die das
|
||||
Verhalten der Funktion definieren beziehungsweise beeinflussen. Parameter
|
||||
für Smarty Funktionen sind HTML Attributen sehr ähnlich.
|
||||
Statische Werte müssen nicht in Anführungszeichen gesetzt werden,
|
||||
für literale Zeichenketten (literal strings) wird dies jedoch empfohlen.
|
||||
</para>
|
||||
<para>
|
||||
Bestimmte Parameter verlangen logische Werte (true / false). Diese
|
||||
können auch ohne Anführungszeichen angegeben werden:
|
||||
<literal>true</literal>, <literal>on</literal> und <literal>yes</literal>
|
||||
- oder <literal>false</literal>, <literal>off</literal> und <literal>no</literal>.
|
||||
</para>
|
||||
<example>
|
||||
<title>Funktions-Parameter Syntax</title>
|
||||
<programlisting>
|
||||
<!-- EN-Revision: 1.3 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.syntax.attributes">
|
||||
<title>Attribute / Parameter</title>
|
||||
<para>
|
||||
Die meisten Funktionen nehmen Parameter entgegen, die das Verhalten
|
||||
der Funktion definieren beziehungsweise beeinflussen. Parameter
|
||||
für Smarty <link
|
||||
linkend="language.syntax.functions">Funktionen</link> sind HTML
|
||||
Attributen sehr ähnlich. Statische Werte müssen nicht in
|
||||
Anführungszeichen gesetzt werden, für literale
|
||||
Zeichenketten (literal strings) wird dies jedoch empfohlen.
|
||||
</para>
|
||||
<para>
|
||||
Bestimmte Parameter verlangen logische Werte (true / false). Diese
|
||||
können auch ohne Anführungszeichen angegeben werden:
|
||||
<literal>true</literal>, <literal>on</literal> und
|
||||
<literal>yes</literal> - oder <literal>false</literal>,
|
||||
<literal>off</literal> und <literal>no</literal>.
|
||||
</para>
|
||||
<example>
|
||||
<title>Funktions-Parameter Syntax</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{include file="header.tpl"}
|
||||
|
||||
{include file="header.tpl" attrib_name="attrib value"}
|
||||
|
||||
{include file=$includeFile}
|
||||
|
||||
{include file=#includeFile#}
|
||||
|
||||
{html_select_date display_days=yes}
|
||||
|
||||
<SELECT name=firma>
|
||||
<select name=firma>
|
||||
{html_options values=$vals selected=$selected output=$output}
|
||||
</SELECT>
|
||||
</select>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
@@ -1,33 +1,46 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.2 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.syntax.comments">
|
||||
<title>Kommentare</title>
|
||||
<para>
|
||||
Kommentare werden von Asterisks umschlossen, und mit Trennzeichen umgeben.
|
||||
Beispiel: {* das ist ein Kommentar *}
|
||||
Smarty-Kommentare werden in der Ausgabe nicht dargestellt und vor allem
|
||||
dazu verwendet, die Templates verständlicher aufzubauen.
|
||||
</para>
|
||||
<example>
|
||||
<title>Kommentare</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
<!-- EN-Revision: 1.3 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.syntax.comments">
|
||||
<title>Kommentare</title>
|
||||
<para>
|
||||
|
||||
Kommentare werden von Asterisks umschlossen, und mit <link
|
||||
linkend="variable.left.delimiter">Trennzeichen</link> umgeben.
|
||||
Beispiel: {* das ist ein Kommentar *} Smarty-Kommentare werden in
|
||||
der Ausgabe nicht dargestellt und vor allem dazu verwendet, die
|
||||
Templates verständlicher aufzubauen. Smarty Kommentare werden
|
||||
sind in der eng<6E>ltigen Ausgabe NICHT dargestellt. (im Gegensatz zu
|
||||
<!-- HTML Kommentaren -->). Sie sind n<>tzlich um in den
|
||||
Templates interne Anmerkungen zu hinterlassen.
|
||||
</para>
|
||||
<example>
|
||||
<title>Kommentare</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{* Smarty *}
|
||||
<body>
|
||||
{* dies ist ein mehrzeiliger
|
||||
Kommentar, der nicht zum
|
||||
Browser gesandt wird.
|
||||
*}
|
||||
</body>
|
||||
|
||||
{* einbinden des Header-Templates *}
|
||||
{include file="header.tpl"}
|
||||
|
||||
{* Entwicklernotiz: $includeFile enth<74>lt 'foo.php' *}
|
||||
{include file=$includeFile}
|
||||
|
||||
{include file=#includeFile#}
|
||||
|
||||
{* Ausgabe der drop-down Liste *}
|
||||
<SELECT name=firma>
|
||||
{html_options values=$vals selected=$selected output=$output}
|
||||
</SELECT>
|
||||
]]></programlisting>
|
||||
</example>
|
||||
<select name=firma>
|
||||
{html_options options=$vals selected=$selected}
|
||||
</select>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
@@ -1,39 +1,58 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.2 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.syntax.functions">
|
||||
<title>Funktionen</title>
|
||||
<para>
|
||||
Jedes Smarty-Tag gibt entweder eine <link linkend="language.variables">Variable</link> aus
|
||||
oder ruft eine Funktion auf. Funktionen werden aufgerufen indem der Funktionsname
|
||||
und die Parameter mit Trennzeichen umschlossen werden. Beispiel: {funcname attr1="val" attr2="val"}.
|
||||
</para>
|
||||
<example>
|
||||
<title>Funktions-Syntax</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
<!-- EN-Revision: 1.6 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.syntax.functions">
|
||||
<title>Funktionen</title>
|
||||
<para>
|
||||
Jedes Smarty-Tag gibt entweder eine <link
|
||||
linkend="language.variables">Variable</link> aus oder ruft eine
|
||||
Funktion auf. Funktionen werden aufgerufen indem der Funktionsname
|
||||
und die <link linkend="language.syntax.attributes">Parameter</link>
|
||||
mit Trennzeichen umschlossen werden. Beispiel: {funcname attr1="val"
|
||||
attr2="val"}.
|
||||
</para>
|
||||
<example>
|
||||
<title>Funktions-Syntax</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{config_load file="colors.conf"}
|
||||
|
||||
{include file="header.tpl"}
|
||||
|
||||
{if $highlight_name}
|
||||
Welcome, <font color="{#fontColor#}">{$name}!</font>
|
||||
Welcome, <font color="{#fontColor#}">{$name}!</font>
|
||||
{else}
|
||||
Welcome, {$name}!
|
||||
{/if}
|
||||
|
||||
{include file="footer.tpl"}
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Sowohl der Aufruf von eingebauten, als auch der von eigenen Funktionen folgt der
|
||||
gleichen Syntax. Eingebaute Funktionen erlauben einige Basis-Operationen wie <command>if</command>, <command>section</command>
|
||||
und <command>strip</command>. Diese Funktionen können nicht verändert werden.
|
||||
Individuelle Funktionen die die Fähigkeiten von Smarty erweitern werden als Plugins implementiert.
|
||||
Diese Funktionen können von Ihnen angepasst werden, oder Sie können selbst neue Plugins
|
||||
hinzufügen. <command>html_options</command> und <command>html_select_date</command> sind Beispiele solcher Funktionen.
|
||||
</para>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Sowohl der Aufruf von <link
|
||||
linkend="language.builtin.functions">eingebauten</link>, als auch
|
||||
der von e<link linkend="language.custom.functions">igenen</link>
|
||||
Funktionen folgt der gleichen Syntax.
|
||||
</para>
|
||||
<para>
|
||||
Eingebaute Funktionen erlauben einige <emphasis
|
||||
role="bold">Basis</emphasis>-Operationen wie <link
|
||||
linkend="language.function.if">if</link>, <link
|
||||
linkend="language.function.section">section</link> und <link
|
||||
linkend="language.function.strip">strip</link>. Diese Funktionen
|
||||
k<>nnen nicht ver<65>ndert werden.
|
||||
</para>
|
||||
<para>
|
||||
Individuelle Funktionen die die F<>higkeiten von Smarty erweitern
|
||||
werden als Plugins implementiert. Diese Funktionen k<>nnen von Ihnen
|
||||
angepasst werden, oder Sie k<>nnen selbst neue Plugins
|
||||
hinzuf<75>gen. <link
|
||||
linkend="language.function.html.options">{html_options}</link> und
|
||||
<link
|
||||
linkend="language.function.html.select.date">{html_select_date}</link>
|
||||
sind Beispiele solcher Funktionen.
|
||||
</para>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
@@ -1,17 +1,20 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.2 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.syntax.quotes">
|
||||
<title>Variablen mit Doppelten Anführungszeichen</title>
|
||||
<para>
|
||||
Smarty erkennt zugewiesene Variablen mit doppelten Anführungszeichen solange
|
||||
die Variablen nur Zahlen, Buchstaben, Understriche oder Klammern [] enthalten. Mit allen
|
||||
anderen Zeichen wie Punkt, Objekt Referenzen, etc muss die Vairable mit Backticks umschlossen sein.
|
||||
</para>
|
||||
<example>
|
||||
<title>Syntax von eingebetteten Anfürungszeichen</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
<!-- EN-Revision: 1.6 Maintainer: andreas Status: ready -->
|
||||
<sect1 id="language.syntax.quotes">
|
||||
<title>Variablen mit Doppelten Anf<EFBFBD>hrungszeichen</title>
|
||||
<para>
|
||||
Smarty erkennt <link linkend="api.assign">zugewiesene</link> <link
|
||||
linkend="language.syntax.variables">Variablen</link> mit doppelten
|
||||
Anf<EFBFBD>hrungszeichen solange die Variablen nur Zahlen, Buchstaben,
|
||||
Understriche oder Klammern [] enthalten. Mit allen anderen Zeichen
|
||||
wie Punkt, Objekt Referenzen, etc muss die Vairable mit Backticks
|
||||
(``) umschlossen sein.
|
||||
</para>
|
||||
<example>
|
||||
<title>Syntax von eingebetteten Anf<6E>rungszeichen</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
SYNTAX BEISPIELE:
|
||||
{func var="test $foo test"} <-- sieht $foo
|
||||
{func var="test $foo_bar test"} <-- sieht $foo_bar
|
||||
@@ -19,14 +22,19 @@ SYNTAX BEISPIELE:
|
||||
{func var="test $foo[bar] test"} <-- sieht $foo[bar]
|
||||
{func var="test $foo.bar test"} <-- sieht $foo (nicht $foo.bar)
|
||||
{func var="test `$foo.bar` test"} <-- sieht $foo.bar
|
||||
{func var="test `$foo.bar` test"|escape} <-- Modifikatoren ausserhalb der Anf<6E>hrungsz.!
|
||||
|
||||
PRAKTISCHE BEISPIELE:
|
||||
{include file="subdir/$tpl_name.tpl"} <-- ersetzt $tpl_name durch wert
|
||||
{cycle values="one,two,`$smarty.config.myval`"} <-- muss Backticks enthalten</programlisting>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Siehe auch <link linkend="language.modifier.escape">escape (Maskieren)</link>.
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
Reference in New Issue
Block a user