Re: [Templates] Patch to implement USE_SINGLETON idea in CAP::TT

[prev] [thread] [next] [Date index for 2005/01/28]

From: Perrin Harkins
Subject: Re: [Templates] Patch to implement USE_SINGLETON idea in CAP::TT
Date: 04:02 on 28 Jan 2005
On Thu, 2005-01-27 at 22:52 -0500, Cees Hek wrote:
> Instead of configuring the object by
> calling $self->tt_config(...) you can now provide all the options when
> you 'use' the module.
> 
> package My::App;
>   
> use base qw(CGI::Application);
> use CGI::Application::Plugin::TT (
>               TEMPLATE_OPTIONS => {
>                         POST_CHOMP   => 1,
>                         FILTERS => {
>                                      'currency' => sub { sprintf('$
> %0.2f', @_) },
>                         },
>               },
> );

As a general rule, I don't like it when modules co-opt import() for
something that is totally different from importing.  I'd rather see this
done in a separate method, at least as an option.

> I've also added a method to change the INCLUDE_PATH dynamically.called
> tt_include_path (as per Perrin's suggestion).

Thanks!  Hopefully that will help make more people aware that this is
allowed with TT, and they can realize some serious performance gains.

- Perrin


_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates

Re: [Templates] Patch to implement USE_SINGLETON idea in CAP::TT
Perrin Harkins 04:02 on 28 Jan 2005

Generated at 08:55 on 15 Mar 2005 by mariachi v0.52