cvs: smarty /docs programmers.sgml
"Messju Mohr" <[email protected]>
| Newsgroups | gmane.comp.php.cvs.smarty |
|---|---|
| Message-ID | <cvsmessju1060248201@cvsserver> |
messju Thu Aug 7 05:23:21 2003 EDT
Modified files:
/smarty/docs programmers.sgml
Log:
docs update on callbacks to the register_*-functions
--
Smarty CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
messju-20030807052321.txt
(text/plain, 10.2 KB)
Index: smarty/docs/programmers.sgml
diff -u smarty/docs/programmers.sgml:1.36 smarty/docs/programmers.sgml:1.37
--- smarty/docs/programmers.sgml:1.36 Tue Aug 5 12:49:31 2003
+++ smarty/docs/programmers.sgml Thu Aug 7 05:23:21 2003
@@ -1121,16 +1121,16 @@
</para>
<para>
- The php-function callback <parameter>impl</parameter> can be either (a) a string
- containing the function name or (b) an array of the form
- <literal>array(&$object, $method)</literal> with
- <literal>&$object</literal> being a reference to an
- object and <literal>$method</literal> being a string
- containing the mehod-name or (c) an array of the form
- <literal>array(&$class, $method)</literal> with
- <literal>$class</literal> being a classname and
- <literal>$method</literal> being a class method of that
- class.
+ The php-function callback <parameter>impl</parameter> can be either (a) a string
+ containing the function name or (b) an array of the form
+ <literal>array(&$object, $method)</literal> with
+ <literal>&$object</literal> being a reference to an
+ object and <literal>$method</literal> being a string
+ containing the mehod-name or (c) an array of the form
+ <literal>array(&$class, $method)</literal> with
+ <literal>$class</literal> being a classname and
+ <literal>$method</literal> being a class method of that
+ class.
</para>
@@ -1160,7 +1160,7 @@
<funcprototype>
<funcdef>void <function>register_compiler_function</function></funcdef>
<paramdef>string <parameter>name</parameter></paramdef>
- <paramdef>string <parameter>impl</parameter></paramdef>
+ <paramdef>mixed <parameter>impl</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<para>
@@ -1168,6 +1168,18 @@
Pass in the compiler function name, followed by the PHP
function that implements it.
</para>
+ <para>
+ The php-function callback <parameter>impl</parameter> can be either (a) a string
+ containing the function name or (b) an array of the form
+ <literal>array(&$object, $method)</literal> with
+ <literal>&$object</literal> being a reference to an
+ object and <literal>$method</literal> being a string
+ containing the mehod-name or (c) an array of the form
+ <literal>array(&$class, $method)</literal> with
+ <literal>$class</literal> being a classname and
+ <literal>$method</literal> being a class method of that
+ class.
+ </para>
</sect1>
<sect1 id="api.register.function">
<title>register_function</title>
@@ -1175,7 +1187,7 @@
<funcprototype>
<funcdef>void <function>register_function</function></funcdef>
<paramdef>string <parameter>name</parameter></paramdef>
- <paramdef>string <parameter>impl</parameter></paramdef>
+ <paramdef>mixed <parameter>impl</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<para>
@@ -1183,6 +1195,18 @@
Pass in the template function name, followed by the PHP
function name that implements it.
</para>
+ <para>
+ The php-function callback <parameter>impl</parameter> can be either (a) a string
+ containing the function name or (b) an array of the form
+ <literal>array(&$object, $method)</literal> with
+ <literal>&$object</literal> being a reference to an
+ object and <literal>$method</literal> being a string
+ containing the mehod-name or (c) an array of the form
+ <literal>array(&$class, $method)</literal> with
+ <literal>$class</literal> being a classname and
+ <literal>$method</literal> being a class method of that
+ class.
+ </para>
<example>
<title>register_function</title>
<programlisting>
@@ -1205,7 +1229,7 @@
<funcprototype>
<funcdef>void <function>register_modifier</function></funcdef>
<paramdef>string <parameter>name</parameter></paramdef>
- <paramdef>string <parameter>impl</parameter></paramdef>
+ <paramdef>mixed <parameter>impl</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<para>
@@ -1213,6 +1237,19 @@
template modifier name, followed by the PHP function that it
implements it.
</para>
+ <para>
+ The php-function callback <parameter>impl</parameter> can be either (a) a string
+ containing the function name or (b) an array of the form
+ <literal>array(&$object, $method)</literal> with
+ <literal>&$object</literal> being a reference to an
+ object and <literal>$method</literal> being a string
+ containing the mehod-name or (c) an array of the form
+ <literal>array(&$class, $method)</literal> with
+ <literal>$class</literal> being a classname and
+ <literal>$method</literal> being a class method of that
+ class.
+ </para>
+
<example>
<title>register_modifier</title>
<programlisting>
@@ -1245,23 +1282,35 @@
<funcsynopsis>
<funcprototype>
<funcdef>void <function>register_outputfilter</function></funcdef>
- <paramdef>string <parameter>function_name</parameter></paramdef>
+ <paramdef>mixed <parameter>function</parameter></paramdef>
</funcprototype>
</funcsynopsis>
- <para>
- Use this to dynamically register outputfilters to operate on
- a template's output before it is displayed. See
- <link linkend="advanced.features.outputfilters">template output
- filters</link>
- for more information on how to set up an output filter function.
- </para>
+ <para>
+ Use this to dynamically register outputfilters to operate on
+ a template's output before it is displayed. See
+ <link linkend="advanced.features.outputfilters">template output
+ filters</link>
+ for more information on how to set up an output filter function.
+ </para>
+ <para>
+ The php-function callback <parameter>function</parameter> can be either (a) a string
+ containing the function name or (b) an array of the form
+ <literal>array(&$object, $method)</literal> with
+ <literal>&$object</literal> being a reference to an
+ object and <literal>$method</literal> being a string
+ containing the mehod-name or (c) an array of the form
+ <literal>array(&$class, $method)</literal> with
+ <literal>$class</literal> being a classname and
+ <literal>$method</literal> being a class method of that
+ class.
+ </para>
</sect1>
<sect1 id="api.register.postfilter">
<title>register_postfilter</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>register_postfilter</function></funcdef>
- <paramdef>string <parameter>function_name</parameter></paramdef>
+ <paramdef>mixed <parameter>function</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<para>
@@ -1270,13 +1319,25 @@
linkend="advanced.features.postfilters">template postfilters</link> for
more information on how to setup a postfiltering function.
</para>
+ <para>
+ The php-function callback <parameter>function</parameter> can be either (a) a string
+ containing the function name or (b) an array of the form
+ <literal>array(&$object, $method)</literal> with
+ <literal>&$object</literal> being a reference to an
+ object and <literal>$method</literal> being a string
+ containing the mehod-name or (c) an array of the form
+ <literal>array(&$class, $method)</literal> with
+ <literal>$class</literal> being a classname and
+ <literal>$method</literal> being a class method of that
+ class.
+ </para>
</sect1>
<sect1 id="api.register.prefilter">
<title>register_prefilter</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>register_prefilter</function></funcdef>
- <paramdef>string <parameter>function_name</parameter></paramdef>
+ <paramdef>mixed <parameter>function</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<para>
@@ -1285,6 +1346,18 @@
linkend="advanced.features.prefilters">template prefilters</link> for
more information on how to setup a prefiltering function.
</para>
+ <para>
+ The php-function callback <parameter>function</parameter> can be either (a) a string
+ containing the function name or (b) an array of the form
+ <literal>array(&$object, $method)</literal> with
+ <literal>&$object</literal> being a reference to an
+ object and <literal>$method</literal> being a string
+ containing the mehod-name or (c) an array of the form
+ <literal>array(&$class, $method)</literal> with
+ <literal>$class</literal> being a classname and
+ <literal>$method</literal> being a class method of that
+ class.
+ </para>
</sect1>
<sect1 id="api.register.resource">
<title>register_resource</title>
@@ -1302,6 +1375,17 @@
<link linkend="template.resources">template resources</link>
for more information on how to setup a function for fetching
templates.
+ </para>
+ <para>
+ The php-function-array <parameter>resource_funcs</parameter>
+ must have 4 or 5 elements. With 4 elements the elements are
+ the functions-callbacks for the respective "source",
+ "timestamp", "secure" and "trusted" functions of the
+ resource. With 5 elements the first element has to be an
+ object reference or a class name of the object or class
+ implementing the resource and the 4 following elements have
+ to be the method names implementing "source", "timestamp",
+ "secure" and "trusted".
</para>
<example>
<title>register_resource</title>