<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>register_outputfilter()</title> <meta name="generator" content="DocBook XSL Stylesheets V1.75.1"> <link rel="home" href="index.html" title="Smarty Manual"> <link rel="up" href="api.functions.html" title="Chapter 13. Smarty Class Methods()"> <link rel="prev" href="api.register.object.html" title="register_object()"> <link rel="next" href="api.register.postfilter.html" title="register_postfilter()"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> <div class="navheader"> <table width="100%" summary="Navigation header"> <tr><th colspan="3" align="center">register_outputfilter()</th></tr> <tr> <td width="20%" align="left"> <a accesskey="p" href="api.register.object.html">Prev</a> </td> <th width="60%" align="center">Chapter 13. Smarty Class Methods()</th> <td width="20%" align="right"> <a accesskey="n" href="api.register.postfilter.html">Next</a> </td> </tr> </table> <hr> </div> <div class="refentry" title="register_outputfilter()"> <a name="api.register.outputfilter"></a><div class="titlepage"></div> <div class="refnamediv"> <h2>Name</h2> <p>register_outputfilter() — dynamically register outputfilters</p> </div> <div class="refsect1" title="Description"> <a name="id3104971"></a><h2>Description</h2> <code class="methodsynopsis"><span class="type">void </span><span class="methodname">register_outputfilter</span>(<span class="methodparam"><span class="type">mixed </span><span class="parameter">function</span></span>);</code><p> Use this to dynamically register <a class="link" href="plugins.outputfilters.html" title="Output Filters">outputfilters</a> to operate on a template's output before it is <a class="link" href="api.display.html" title="display()">displayed</a>. See <a class="link" href="advanced.features.outputfilters.html" title="Output Filters">template output filters</a> for more information on how to set up an output filter function. </p> <p> The php-function callback <em class="parameter"><code>function</code></em> can be either: </p> <div class="itemizedlist"><ul class="itemizedlist" type="disc"> <li class="listitem"><p> A string containing the function <em class="parameter"><code>name</code></em> </p></li> <li class="listitem"><p> An array of the form <code class="literal">array(&$object, $method)</code> with <code class="literal">&$object</code> being a reference to an object and <code class="literal">$method</code> being a string containing the method-name </p></li> <li class="listitem"><p> An array of the form <code class="literal">array($class, $method)</code> with <code class="literal">$class</code> being the class name and <code class="literal">$method</code> being a method of the class. </p></li> </ul></div> <p> </p> <div class="note" title="Technical Note" style="margin-left: 0.5in; margin-right: 0.5in;"> <h3 class="title">Technical Note</h3> <p> If the chosen <em class="parameter"><code>function</code></em> callback is of the form <code class="literal">array(&$object, $method)</code>, only one instance of the same class and with the same <code class="literal">$method</code> can be registered. The latest registered <em class="parameter"><code>function</code></em> callback will be used in such a scenario. </p> </div> <p> See also <a class="link" href="api.unregister.outputfilter.html" title="unregister_outputfilter()"><code class="varname">unregister_outputfilter()</code></a>, <a class="link" href="api.load.filter.html" title="load_filter()"><code class="varname">load_filter()</code></a>, <a class="link" href="variable.autoload.filters.html" title="$autoload_filters"><em class="parameter"><code>$autoload_filters</code></em></a> and the <a class="link" href="advanced.features.outputfilters.html" title="Output Filters">template output filters</a> section. </p> </div> </div> <div class="navfooter"> <hr> <table width="100%" summary="Navigation footer"> <tr> <td width="40%" align="left"> <a accesskey="p" href="api.register.object.html">Prev</a> </td> <td width="20%" align="center"><a accesskey="u" href="api.functions.html">Up</a></td> <td width="40%" align="right"> <a accesskey="n" href="api.register.postfilter.html">Next</a> </td> </tr> <tr> <td width="40%" align="left" valign="top">register_object() </td> <td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td> <td width="40%" align="right" valign="top"> register_postfilter()</td> </tr> </table> </div> </body> </html>