title: Smarty Postfilters / Prefilters how to apply on template before output
body: <p>I am rather confused about how to use post / pre filters with smarty. </p>
  
  <p>What I need to do, is to search and replace certain elements in the page before it is displayed. I would rather like to do this right before $smarty->display is called. That means, before it gets saved to disk, but after it has been compiled (so, postfilter). </p>
  
  <p>Example postfilter function: </p>
  
  <pre><code>function smarty_postfilter_replace($tpl_output, $search, $replace)
  {
      return str_replace($search, $replace, $tpl_output);
  }
  </code></pre>
  
  <p>How do I apply this right before smarty output. I have tried after looking at the Smarty documentation ( <a href="http://www.smarty.net/docsv2/de/advanced.features.postfilters.tpl" rel="nofollow">http://www.smarty.net/docsv2/de/advanced.features.postfilters.tpl</a> ) and some other examples, but none seems to be working. </p>
  
  <p>can someone give me an example code on how to do this, and how to pass parameters to the filter ($search, $replace). </p>
  
  <p>Thanks</p>