add links

This commit is contained in:
pete_morgan
2005-09-13 17:12:41 +00:00
parent 92d8d3af4f
commit ddbf3e447a
2 changed files with 25 additions and 10 deletions

View File

@@ -6,7 +6,8 @@
Template postfilters are PHP functions that your templates are ran through
after they are compiled. Postfilters can be either
<link linkend="api.register.postfilter">registered</link> or loaded
from the plugins directory by using
from the <link linkend="variable.plugins.dir">plugins directory</link>
by using
<link linkend="api.load.filter">load_filter()</link> function or by
setting
<link linkend="variable.autoload.filters">$autoload_filters</link>
@@ -26,8 +27,8 @@ function add_header_comment($tpl_source, &$smarty)
}
// register the postfilter
$smarty->register_postfilter("add_header_comment");
$smarty->display("index.tpl");
$smarty->register_postfilter('add_header_comment');
$smarty->display('index.tpl');
?>
]]>
</programlisting>
@@ -41,6 +42,13 @@ $smarty->display("index.tpl");
]]>
</screen>
</example>
<para>
See also <link linkend="api.register.postfilter">register_postfilter()</link>,
<link linkend="advanced.features.prefilters">prefilters</link>
and
<link linkend="api.load.filter">load_filter()</link>
</para>
</sect1>
<!-- Keep this comment at the end of the file
Local variables:

View File

@@ -11,7 +11,8 @@
<para>
Prefilters can be either <link
linkend="api.register.prefilter">registered</link> or loaded from
the plugins directory by using <link
the <link linkend="variable.plugins.dir">plugins directory</link>
by using <link
linkend="api.load.filter">load_filter()</link> function or by setting
the <link linkend="variable.autoload.filters">$autoload_filters</link>
variable.
@@ -22,25 +23,31 @@
</para>
<example>
<title>using a template prefilter</title>
<para>
This will remove all the comments in the template source.
</para>
<programlisting role="php">
<![CDATA[
<?php
// put this in your application
function remove_dw_comments($tpl_source, &$smarty)
{
return preg_replace("/<!--#.*-->/U","",$tpl_source);
return preg_replace("/<!--#.*-->/U",'',$tpl_source);
}
// register the prefilter
$smarty->register_prefilter("remove_dw_comments");
$smarty->display("index.tpl");
$smarty->register_prefilter('remove_dw_comments');
$smarty->display('index.tpl');
?>
]]>
</programlisting>
<para>
This will remove all the comments in the template source.
</para>
</example>
<para>See also <link linkend="api.register.prefilter">register_prefilter()</link>,
<link linkend="advanced.features.postfilters">postfilters</link>
and
<link linkend="api.load.filter">load_filter()</link>
</para>
</sect1>
<!-- Keep this comment at the end of the file
Local variables: