2004-04-13 08:46:28 +00:00
|
|
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
|
|
|
|
<!-- $Revision$ -->
|
2005-06-23 18:56:00 +00:00
|
|
|
|
<!-- EN-Revision: 1.8 Maintainer: andreas Status: ready -->
|
|
|
|
|
|
<sect1 id="language.function.include">
|
|
|
|
|
|
<title>include (einbinden)</title>
|
|
|
|
|
|
<informaltable frame="all">
|
|
|
|
|
|
<tgroup cols="5">
|
|
|
|
|
|
<colspec colname="param" align="center" />
|
|
|
|
|
|
<colspec colname="type" align="center" />
|
|
|
|
|
|
<colspec colname="required" align="center" />
|
|
|
|
|
|
<colspec colname="default" align="center" />
|
|
|
|
|
|
<colspec colname="desc" />
|
|
|
|
|
|
<thead>
|
|
|
|
|
|
<row>
|
|
|
|
|
|
<entry>Attribut Name</entry>
|
|
|
|
|
|
<entry>Typ</entry>
|
|
|
|
|
|
<entry>Erforderlich</entry>
|
|
|
|
|
|
<entry>Standardwert</entry>
|
|
|
|
|
|
<entry>Beschreibung</entry>
|
|
|
|
|
|
</row>
|
|
|
|
|
|
</thead>
|
|
|
|
|
|
<tbody>
|
|
|
|
|
|
<row>
|
|
|
|
|
|
<entry>file</entry>
|
|
|
|
|
|
<entry>string</entry>
|
|
|
|
|
|
<entry>Ja</entry>
|
|
|
|
|
|
<entry><emphasis>n/a</emphasis></entry>
|
|
|
|
|
|
<entry>Name der Template-Datei, die eingebunden werden soll.</entry>
|
|
|
|
|
|
</row>
|
|
|
|
|
|
<row>
|
|
|
|
|
|
<entry>assign</entry>
|
|
|
|
|
|
<entry>string</entry>
|
|
|
|
|
|
<entry>Nein</entry>
|
|
|
|
|
|
<entry><emphasis>n/a</emphasis></entry>
|
|
|
|
|
|
<entry>Variable, welcher der eingebundene Inhalt zugewiesen werden soll.</entry>
|
|
|
|
|
|
</row>
|
|
|
|
|
|
<row>
|
|
|
|
|
|
<entry>[var ...]</entry>
|
|
|
|
|
|
<entry>[var typ]</entry>
|
|
|
|
|
|
<entry>Nein</entry>
|
|
|
|
|
|
<entry><emphasis>n/a</emphasis></entry>
|
|
|
|
|
|
<entry>Variablen welche dem Template lokal <20>bergeben werden sollen.</entry>
|
|
|
|
|
|
</row>
|
|
|
|
|
|
</tbody>
|
|
|
|
|
|
</tgroup>
|
|
|
|
|
|
</informaltable>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
Include Tags werden verwendet, um andere Templates in das aktuelle
|
|
|
|
|
|
Template einzubinden. Alle Variablen des aktuellen Templates sind
|
|
|
|
|
|
auch im eingebundenen Template verf<72>gbar. Das include-Tag muss ein
|
|
|
|
|
|
'file' Attribut mit dem Pfad zum einzubindenden Template enthalten.
|
|
|
|
|
|
</para>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
Optional kann mit dem <emphasis>assign</emphasis> Attribut definiert
|
|
|
|
|
|
werden, in welcher Variable die Ausgabe des mit
|
|
|
|
|
|
<emphasis>include</emphasis> eingebundenen Templates abgelegt werden
|
|
|
|
|
|
soll statt sie auszugeben.
|
|
|
|
|
|
</para>
|
|
|
|
|
|
<example>
|
|
|
|
|
|
<title>function include (einbinden)</title>
|
|
|
|
|
|
<programlisting>
|
|
|
|
|
|
<![CDATA[
|
|
|
|
|
|
<html>
|
|
|
|
|
|
<head>
|
|
|
|
|
|
<title>{$title}</title>
|
|
|
|
|
|
</head>
|
|
|
|
|
|
<body>
|
|
|
|
|
|
{include file="page_header.tpl"}
|
2004-04-13 08:46:28 +00:00
|
|
|
|
|
|
|
|
|
|
{* hier kommt der body des Templates *}
|
2005-06-23 18:56:00 +00:00
|
|
|
|
{include file="/$tpl_name.tpl"} <-- $tpl_name wird durch eine Wert ersetzt
|
2004-04-13 08:46:28 +00:00
|
|
|
|
|
2005-06-23 18:56:00 +00:00
|
|
|
|
{include file="page_footer.tpl"}
|
|
|
|
|
|
</body>
|
|
|
|
|
|
</html>
|
|
|
|
|
|
]]>
|
|
|
|
|
|
</programlisting>
|
|
|
|
|
|
</example>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
Sie k<>nnen dem einzubindenden Template Variablen als Attribute
|
|
|
|
|
|
<20>bergeben. Alle explizit <20>bergebenen Variablen sind nur im
|
|
|
|
|
|
Anwendungsbereich (scope) dieses Template
|
|
|
|
|
|
verf<72>gbar. Attribut-Variablen <20>berschreiben aktuelle
|
|
|
|
|
|
Template-Variablen, falls sie den gleichen Namen haben.
|
|
|
|
|
|
</para>
|
|
|
|
|
|
<example>
|
|
|
|
|
|
<title>include-Funktion und Variablen <20>bergabe</title>
|
|
|
|
|
|
<programlisting>
|
|
|
|
|
|
<![CDATA[
|
2004-04-13 08:46:28 +00:00
|
|
|
|
{include file="header.tpl" title="Hauptmenu" table_bgcolor="#c0c0c0"}
|
|
|
|
|
|
|
|
|
|
|
|
{* hier kommt der body des Templates *}
|
|
|
|
|
|
|
2005-06-23 18:56:00 +00:00
|
|
|
|
{include file="footer.tpl" logo="http://my.domain.com/logo.gif"}
|
|
|
|
|
|
]]>
|
|
|
|
|
|
</programlisting>
|
|
|
|
|
|
</example>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
Benutzen sie die Syntax von <link
|
|
|
|
|
|
linkend="template.resources">template resources</link>, um Templates
|
|
|
|
|
|
ausserhalb des '$template_dir' einzubinden:
|
|
|
|
|
|
</para>
|
|
|
|
|
|
<example>
|
|
|
|
|
|
<title>Beispiele f<>r Template-Ressourcen bei der 'include'-Funktion</title>
|
|
|
|
|
|
<programlisting>
|
|
|
|
|
|
<![CDATA[
|
2004-04-13 08:46:28 +00:00
|
|
|
|
{* absoluter Dateipfad *}
|
|
|
|
|
|
{include file="/usr/local/include/templates/header.tpl"}
|
|
|
|
|
|
|
|
|
|
|
|
{* absoluter Dateipfad (gleich) *}
|
|
|
|
|
|
{include file="file:/usr/local/include/templates/header.tpl"}
|
|
|
|
|
|
|
2005-06-23 18:56:00 +00:00
|
|
|
|
{* absoluter Dateipfad unter Windows ("file:"-Prefix MUSS <20>bergeben werden) *}
|
2004-04-13 08:46:28 +00:00
|
|
|
|
{include file="file:C:/www/pub/templates/header.tpl"}
|
|
|
|
|
|
|
|
|
|
|
|
{* einbinden aus Template-Ressource namens 'db' *}
|
2005-06-23 18:56:00 +00:00
|
|
|
|
{include file="db:header.tpl"}
|
|
|
|
|
|
]]>
|
|
|
|
|
|
</programlisting>
|
|
|
|
|
|
</example>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
Siehe auch
|
|
|
|
|
|
<link linkend="language.function.include.php">{include_php}</link>,
|
|
|
|
|
|
<link linkend="language.function.php">{php}</link>,
|
|
|
|
|
|
<link linkend="template.resources">Template Ressourcen</link> und
|
|
|
|
|
|
<link linkend="tips.componentized.templates">Template/Skript Komponenten</link>.
|
|
|
|
|
|
</para>
|
2004-04-13 08:46:28 +00:00
|
|
|
|
</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
|
2004-07-16 14:32:31 +00:00
|
|
|
|
-->
|