mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-06 03:14:27 +02:00
more linking :-)
This commit is contained in:
@@ -3,19 +3,23 @@
|
|||||||
<sect1 id="advanced.features.outputfilters">
|
<sect1 id="advanced.features.outputfilters">
|
||||||
<title>Output Filters</title>
|
<title>Output Filters</title>
|
||||||
<para>
|
<para>
|
||||||
When the template is invoked via display() or fetch(), its output can be
|
When the template is invoked via
|
||||||
sent through one or more output filters. This differs from postfilters
|
<link linkend="api.display">display()</link> or
|
||||||
|
<link linkend="api.fetch">fetch()</link>, its output can be
|
||||||
|
sent through one or more output filters. This differs from
|
||||||
|
<link linkend="advanced.features.postfilters">postfilters</link>
|
||||||
because postfilters operate on compiled templates before they are saved to
|
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.
|
executed.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Output filters can be either
|
Output filters can be either
|
||||||
<link linkend="api.register.outputfilter">registered</link> or loaded
|
<link linkend="api.register.outputfilter">registered</link> or loaded
|
||||||
from the plugins directory by using
|
from the
|
||||||
|
<link linkend="variable.plugins.dir">plugins directory</link> by using the
|
||||||
<link linkend="api.load.filter">load_filter()</link> function or by
|
<link linkend="api.load.filter">load_filter()</link> function or by
|
||||||
setting
|
setting the
|
||||||
<link linkend="variable.autoload.filters">$autoload_filters</link>
|
<link linkend="variable.autoload.filters">$autoload_filters</link>
|
||||||
variable. Smarty will pass the template output as the first argument,
|
variable. Smarty will pass the template output as the first argument,
|
||||||
and expect the function to return the result of the processing.
|
and expect the function to return the result of the processing.
|
||||||
@@ -35,8 +39,8 @@ function protect_email($tpl_output, &$smarty)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// register the outputfilter
|
// register the outputfilter
|
||||||
$smarty->register_outputfilter("protect_email");
|
$smarty->register_outputfilter('protect_email');
|
||||||
$smarty->display("index.tpl");
|
$smarty->display('index.tpl');
|
||||||
|
|
||||||
// now any occurrence of an email address in the template output will have
|
// now any occurrence of an email address in the template output will have
|
||||||
// a simple protection against spambots
|
// a simple protection against spambots
|
||||||
@@ -44,6 +48,14 @@ $smarty->display("index.tpl");
|
|||||||
]]>
|
]]>
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</example>
|
</example>
|
||||||
|
<para>
|
||||||
|
See also
|
||||||
|
<link linkend="api.register.outputfilter">register_outpurfilter()</link>,
|
||||||
|
<link linkend="api.load.filter">load_filter()</link>,
|
||||||
|
<link linkend="variable.autoload.filters">$autoload_filters</link>
|
||||||
|
<link linkend="advanced.features.postfilters">postfilters</link> and
|
||||||
|
<link linkend="variable.plugins.dir">plugins directory</link>.
|
||||||
|
</para>
|
||||||
</sect1>
|
</sect1>
|
||||||
<!-- Keep this comment at the end of the file
|
<!-- Keep this comment at the end of the file
|
||||||
Local variables:
|
Local variables:
|
||||||
|
Reference in New Issue
Block a user