[Catalyst] Re: using template plugins
Aristotle Pagaltzis
pagaltzis at gmx.de
Wed Oct 13 18:09:27 GMT 2010
Hi Stuart,
* Stuart Dodds <dodds at united-domains.de> [2010-10-13 18:35]:
> I use template toolkit in my catalyst application and need to
> use the plugin Template::Plugin::UTF8Decode in several template
> files. I can do what it says in the synopsis for this module:
> [% use UTF8Decode %] at the top of every template, which works
> fine but my question is, is there a way to use this plugin (or
> any other template plugin) in catalyst so that it is included
> in all templates rather than having to use it in each template
> separately.
this is not a Catalyst question, it’s a Template::Toolkit one.
The answer is to put `[% USE UTF8Decode %]` in `prepare.tt` and
add `PREPROCESS => 'prepare.tt'` to your TT config. Adjust the
name of the include file to taste, obviously, and list multiple
files by passing an array ref instead of a string.
Regards,
--
Aristotle Pagaltzis // <http://plasmasturm.org/>
More information about the Catalyst
mailing list