From c67679aa6f52b419a2e7c95edf8c4fe02f85b6c1 Mon Sep 17 00:00:00 2001 From: pete_morgan Date: Sat, 18 Feb 2006 12:12:48 +0000 Subject: [PATCH] more linking :-) --- .../advanced-features-outputfilters.xml | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/docs/en/programmers/advanced-features/advanced-features-outputfilters.xml b/docs/en/programmers/advanced-features/advanced-features-outputfilters.xml index cc55a479..f7d381a5 100644 --- a/docs/en/programmers/advanced-features/advanced-features-outputfilters.xml +++ b/docs/en/programmers/advanced-features/advanced-features-outputfilters.xml @@ -3,19 +3,23 @@ Output Filters - When the template is invoked via display() or fetch(), its output can be - sent through one or more output filters. This differs from postfilters + When the template is invoked via + display() or + fetch(), its output can be + sent through one or more output filters. This differs from + postfilters because postfilters operate on compiled templates before they are saved to - the disk, and output filters operate on the template output when it is + the disk, wheras output filters operate on the template output when it is executed. Output filters can be either registered or loaded - from the plugins directory by using + from the + plugins directory by using the load_filter() function or by - setting + setting the $autoload_filters variable. Smarty will pass the template output as the first argument, and expect the function to return the result of the processing. @@ -35,8 +39,8 @@ function protect_email($tpl_output, &$smarty) } // register the outputfilter -$smarty->register_outputfilter("protect_email"); -$smarty->display("index.tpl"); +$smarty->register_outputfilter('protect_email'); +$smarty->display('index.tpl'); // now any occurrence of an email address in the template output will have // a simple protection against spambots @@ -44,6 +48,14 @@ $smarty->display("index.tpl"); ]]> + + See also + register_outpurfilter(), + load_filter(), + $autoload_filters + postfilters and + plugins directory. +