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

View File

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