docs update on callbacks to the register_*-functions

This commit is contained in:
messju
2003-08-07 09:23:21 +00:00
parent 5224b83caa
commit 7028e8da55

View File

@@ -1121,16 +1121,16 @@ $smarty->load_filter('output', 'compress'); // load output filter named 'compres
</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 @@ function do_translation ($params, $content, &$smarty, &amp;$repeat) {
<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 @@ function do_translation ($params, $content, &$smarty, &amp;$repeat) {
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 @@ function do_translation ($params, $content, &$smarty, &amp;$repeat) {
<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 @@ function do_translation ($params, $content, &$smarty, &amp;$repeat) {
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 @@ function print_current_date ($params) {
<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 @@ function print_current_date ($params) {
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 @@ $smarty->register_modifier("sslash","stripslashes");
<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 @@ $smarty->register_modifier("sslash","stripslashes");
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 @@ $smarty->register_modifier("sslash","stripslashes");
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>
@@ -1303,6 +1376,17 @@ $smarty->register_modifier("sslash","stripslashes");
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>
<programlisting>