Smarty prefilters need to have the compiled templates wiped to work.

I just thought I would drop this little tidbit to help save someone some time (hopefully). In the smarty template engine there is a pretty useful call “register_prefilter” which basically lets you pass a function to smarty that gets run on the whole template file before the template file itself has any of the substitutions made to it. This can be a god-send, however the first time you use it it probably won’t seem like it’s working. The secret is that you need to go into your templates_c directory, and dump all of the compiled templates every time you change the pre-filter.

Leave a Reply

Your email address will not be published. Required fields are marked *