[Catalyst] Subclass Catalyst::View::TT to use Template::Foo instead of Template?

Larry Leszczynski larryl at emailplus.org
Wed Jan 28 19:05:31 GMT 2009


Is there any straightforward way to create a subclass of
Catalyst::View::TT so that $self->{template} is an instance of
Template::Foo instead of Template?

In e.g. Catalyst::View::TT::Foo I could call $self->SUPER::new() and
then overwrite the resulting $self->{template} object, but at that point
I don't have access to the $config that was passed to Template->new(). 
It looks like I'd have to copy out all of the relevant info from
$self->{template}, and then use it to create a new Template::Foo, which
looks like it would be unwieldy and hard to maintain.

Or would it make sense to modify Catalyst::View::TT to accept a new
config argument like TEMPLATE_CLASSNAME (that defaults to "Template")?


Thanks in advance,
Larry



More information about the Catalyst mailing list