From 7028e8da55efc427880c4c3cb4b074f4414099be Mon Sep 17 00:00:00 2001 From: messju Date: Thu, 7 Aug 2003 09:23:21 +0000 Subject: [PATCH] docs update on callbacks to the register_*-functions --- docs/programmers.sgml | 130 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 107 insertions(+), 23 deletions(-) diff --git a/docs/programmers.sgml b/docs/programmers.sgml index 15647f7b..720eda08 100644 --- a/docs/programmers.sgml +++ b/docs/programmers.sgml @@ -1121,16 +1121,16 @@ $smarty->load_filter('output', 'compress'); // load output filter named 'compres - The php-function callback impl can be either (a) a string - containing the function name or (b) an array of the form - array(&$object, $method) with - &$object being a reference to an - object and $method being a string - containing the mehod-name or (c) an array of the form - array(&$class, $method) with - $class being a classname and - $method being a class method of that - class. + The php-function callback impl can be either (a) a string + containing the function name or (b) an array of the form + array(&$object, $method) with + &$object being a reference to an + object and $method being a string + containing the mehod-name or (c) an array of the form + array(&$class, $method) with + $class being a classname and + $method being a class method of that + class. @@ -1160,7 +1160,7 @@ function do_translation ($params, $content, &$smarty, &$repeat) { void register_compiler_function string name - string impl + mixed impl @@ -1168,6 +1168,18 @@ function do_translation ($params, $content, &$smarty, &$repeat) { Pass in the compiler function name, followed by the PHP function that implements it. + + The php-function callback impl can be either (a) a string + containing the function name or (b) an array of the form + array(&$object, $method) with + &$object being a reference to an + object and $method being a string + containing the mehod-name or (c) an array of the form + array(&$class, $method) with + $class being a classname and + $method being a class method of that + class. + register_function @@ -1175,7 +1187,7 @@ function do_translation ($params, $content, &$smarty, &$repeat) { void register_function string name - string impl + mixed impl @@ -1183,6 +1195,18 @@ function do_translation ($params, $content, &$smarty, &$repeat) { Pass in the template function name, followed by the PHP function name that implements it. + + The php-function callback impl can be either (a) a string + containing the function name or (b) an array of the form + array(&$object, $method) with + &$object being a reference to an + object and $method being a string + containing the mehod-name or (c) an array of the form + array(&$class, $method) with + $class being a classname and + $method being a class method of that + class. + register_function @@ -1205,7 +1229,7 @@ function print_current_date ($params) { void register_modifier string name - string impl + mixed impl @@ -1213,6 +1237,19 @@ function print_current_date ($params) { template modifier name, followed by the PHP function that it implements it. + + The php-function callback impl can be either (a) a string + containing the function name or (b) an array of the form + array(&$object, $method) with + &$object being a reference to an + object and $method being a string + containing the mehod-name or (c) an array of the form + array(&$class, $method) with + $class being a classname and + $method being a class method of that + class. + + register_modifier @@ -1245,23 +1282,35 @@ $smarty->register_modifier("sslash","stripslashes"); void register_outputfilter - string function_name + mixed function - - Use this to dynamically register outputfilters to operate on - a template's output before it is displayed. See - template output - filters - for more information on how to set up an output filter function. - + + Use this to dynamically register outputfilters to operate on + a template's output before it is displayed. See + template output + filters + for more information on how to set up an output filter function. + + + The php-function callback function can be either (a) a string + containing the function name or (b) an array of the form + array(&$object, $method) with + &$object being a reference to an + object and $method being a string + containing the mehod-name or (c) an array of the form + array(&$class, $method) with + $class being a classname and + $method being a class method of that + class. + register_postfilter void register_postfilter - string function_name + mixed function @@ -1270,13 +1319,25 @@ $smarty->register_modifier("sslash","stripslashes"); linkend="advanced.features.postfilters">template postfilters for more information on how to setup a postfiltering function. + + The php-function callback function can be either (a) a string + containing the function name or (b) an array of the form + array(&$object, $method) with + &$object being a reference to an + object and $method being a string + containing the mehod-name or (c) an array of the form + array(&$class, $method) with + $class being a classname and + $method being a class method of that + class. + register_prefilter void register_prefilter - string function_name + mixed function @@ -1285,6 +1346,18 @@ $smarty->register_modifier("sslash","stripslashes"); linkend="advanced.features.prefilters">template prefilters for more information on how to setup a prefiltering function. + + The php-function callback function can be either (a) a string + containing the function name or (b) an array of the form + array(&$object, $method) with + &$object being a reference to an + object and $method being a string + containing the mehod-name or (c) an array of the form + array(&$class, $method) with + $class being a classname and + $method being a class method of that + class. + register_resource @@ -1303,6 +1376,17 @@ $smarty->register_modifier("sslash","stripslashes"); for more information on how to setup a function for fetching templates. + + The php-function-array resource_funcs + 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". + register_resource