mirror of
				https://github.com/smarty-php/smarty.git
				synced 2025-11-03 22:01:36 +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
		
			
				
	
	
		
			75 lines
		
	
	
		
			2.3 KiB
		
	
	
	
		
			XML
		
	
	
	
	
	
			
		
		
	
	
			75 lines
		
	
	
		
			2.3 KiB
		
	
	
	
		
			XML
		
	
	
	
	
	
<?xml version="1.0" encoding="iso-8859-1"?>
 | 
						|
<!-- $Revision$ -->
 | 
						|
<!-- EN-Revision: 1.2 Maintainer: andreas Status: ready -->
 | 
						|
  <sect1 id="plugins.inserts"><title>Inserts</title>
 | 
						|
   <para>
 | 
						|
    Insert-Plugins werden verwendet, um Funktionen zu implementieren, die
 | 
						|
    via <link linkend="language.function.insert"><command>insert</command></link> aufgerufen werden.
 | 
						|
   </para>
 | 
						|
   <funcsynopsis>
 | 
						|
    <funcprototype>
 | 
						|
     <funcdef>string <function>smarty_insert_<replaceable>name</replaceable></function></funcdef>
 | 
						|
     <paramdef>array <parameter>$params</parameter></paramdef>
 | 
						|
     <paramdef>object <parameter>&$smarty</parameter></paramdef>
 | 
						|
    </funcprototype>
 | 
						|
   </funcsynopsis>
 | 
						|
   <para>
 | 
						|
    Als erster Parameter wird der Funktion ein assoziatives Array aller Attribute
 | 
						|
    übergeben, die im Insert-Tag notiert wurden. Sie können
 | 
						|
    auf diese Werte entweder direkt mit <varname>$params['start']</varname> zugreifen
 | 
						|
    oder sie mit <varname>extract($params)</varname> importieren.
 | 
						|
   </para>
 | 
						|
   <para>
 | 
						|
    Als Rückgabewert muss das Resultat der Ausführung geliefert werden,
 | 
						|
    das danach den Platz des <command>insert</command>-Tags im Template einnimmt.
 | 
						|
   </para>
 | 
						|
   <example>
 | 
						|
    <title>Insert-Plugin</title>
 | 
						|
    <programlisting>
 | 
						|
<![CDATA[
 | 
						|
<?php
 | 
						|
/*
 | 
						|
 * Smarty plugin
 | 
						|
 * -------------------------------------------------------------
 | 
						|
 * File:     insert.time.php
 | 
						|
 * Type:     time
 | 
						|
 * Name:     time
 | 
						|
 * Purpose:  Inserts current date/time according to format
 | 
						|
 * -------------------------------------------------------------
 | 
						|
 */
 | 
						|
function smarty_insert_time($params, &$smarty)
 | 
						|
{
 | 
						|
    if (empty($params['format'])) {
 | 
						|
        $smarty->trigger_error("insert time: missing 'format' parameter");
 | 
						|
        return;
 | 
						|
    }
 | 
						|
 | 
						|
    $datetime = strftime($params['format']);
 | 
						|
    return $datetime;
 | 
						|
}
 | 
						|
?>
 | 
						|
]]>
 | 
						|
     </programlisting>
 | 
						|
   </example>
 | 
						|
</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
 | 
						|
-->
 |