mirror of
				https://github.com/smarty-php/smarty.git
				synced 2025-10-31 04:11:37 +01:00 
			
		
		
		
	- updates for new build system - added missing files - corrections from users - revcheck comments for all files - big up to didou and nuno, brilliant work - make test: ok - make: ok
		
			
				
	
	
		
			112 lines
		
	
	
		
			3.5 KiB
		
	
	
	
		
			XML
		
	
	
	
	
	
			
		
		
	
	
			112 lines
		
	
	
		
			3.5 KiB
		
	
	
	
		
			XML
		
	
	
	
	
	
| <?xml version="1.0" encoding="iso-8859-1"?>
 | |
| <!-- $Revision$ -->
 | |
| <!-- EN-Revision: 1.3 Maintainer: andreas Status: ready -->
 | |
| <refentry id="api.display">
 | |
|  <refnamediv>
 | |
|   <refname>display (ausgeben)</refname>
 | |
|   <refpurpose></refpurpose>
 | |
|  </refnamediv>
 | |
|  <refsect1>
 | |
|   <title />
 | |
|   <methodsynopsis>
 | |
|    <type>void</type><methodname>display</methodname>
 | |
|    <methodparam><type>string</type><parameter>template</parameter></methodparam>
 | |
|    <methodparam choice="opt"><type>string</type><parameter>cache_id</parameter></methodparam>
 | |
|    <methodparam choice="opt"><type>string</type><parameter>compile_id</parameter></methodparam>
 | |
|   </methodsynopsis>
 | |
|    <para>
 | |
|     Gibt ein Template aus. Sie müssen einen gültigen
 | |
|     <link linkend="template.resources">Template Ressourcen</link>-Typ
 | |
|     inklusive Pfad angeben. Als optionalen zweiten Parameter können 
 | |
|     Sie eine 'cache_id' übergeben. Konsultieren
 | |
|     Sie den Abschnitt über <link linkend="caching">caching</link> für weitere Informationen.
 | |
|    </para>
 | |
|    <para>
 | |
|     Als optionalen dritten Parameter können Sie eine 'compile_id' übergeben.
 | |
|     Dies ist wertvoll, falls Sie verschiedene Versionen eines Templates
 | |
|     kompilieren wollen - zum Beispiel in verschiedenen Sprachen. 'compile_id'
 | |
|     wird auch verwendet, wenn Sie mehr als ein '$template_dir' aber nur ein
 | |
|     '$compile_dir' haben. Setzen Sie dazu für jedes Verzeichnis eine
 | |
|     eigene 'compile_id', andernfalls werden Templates mit dem gleichen Namen
 | |
|     überschrieben. Sie können die Variable <link linkend="variable.compile.id">$compile_id</link>
 | |
|     auch einmalig setzen, anstatt sie bei jedem Aufruf von 'display()' zu übergeben.
 | |
|    </para>
 | |
|    <example>
 | |
|     <title>display (ausgeben)</title>
 | |
|     <programlisting>
 | |
| <![CDATA[
 | |
| <?php
 | |
| include("Smarty.class.php");
 | |
| $smarty = new Smarty;
 | |
| $smarty->caching = true;
 | |
| 
 | |
| // Datenbank-Aufrufe nur durchführen, wenn kein Cache existiert
 | |
| if(!$smarty->is_cached("index.tpl")) {
 | |
| 
 | |
|   // Beispieldaten
 | |
|   $address = "245 N 50th";
 | |
|   $db_data = array(
 | |
|                "City" => "Lincoln",
 | |
|                "State" => "Nebraska",
 | |
|                "Zip" => "68502"
 | |
|              );
 | |
| 
 | |
|   $smarty->assign("Name","Fred");
 | |
|   $smarty->assign("Address",$address);
 | |
|   $smarty->assign($db_data);
 | |
| 
 | |
| }
 | |
| 
 | |
| // ausgabe
 | |
| $smarty->display("index.tpl");
 | |
| ?>
 | |
| ]]>
 | |
| </programlisting>
 | |
|    </example>
 | |
|    <para>
 | |
|     Verwenden Sie die Syntax von <link linkend="template.resources">template resources</link>
 | |
|     um Dateien ausserhalb von '$template_dir' zu verwenden.
 | |
|    </para>
 | |
|    <example>
 | |
|     <title>Beispiele von Template-Ressourcen für 'display()'</title>
 | |
|     <programlisting>
 | |
| <![CDATA[
 | |
| <?php
 | |
| // absoluter Dateipfad
 | |
| $smarty->display("/usr/local/include/templates/header.tpl");
 | |
| 
 | |
| // absoluter Dateipfad (alternativ)
 | |
| $smarty->display("file:/usr/local/include/templates/header.tpl");
 | |
| 
 | |
| // absoluter Dateipfad unter Windows (MUSS mit 'file:'-Prefix versehen werden)
 | |
| $smarty->display("file:C:/www/pub/templates/header.tpl");
 | |
| 
 | |
| // aus der Template-Ressource 'db' einbinden
 | |
| $smarty->display("db:header.tpl");
 | |
| ?>
 | |
| ]]>     
 | |
| </programlisting>
 | |
|    </example>
 | |
|  </refsect1>
 | |
| </refentry>
 | |
| <!-- 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
 | |
| -->
 |