mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-06 11:24:27 +02:00
add links
This commit is contained in:
@@ -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:
|
||||
|
@@ -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:
|
||||
|
Reference in New Issue
Block a user