[Catalyst] Patch for Catalyst::View::Mason

Rick Delaney rick at bort.ca
Sat Mar 8 02:23:02 GMT 2008


On Mar 07 2008, Jonathan Rockway wrote:
> * On Fri, Mar 07 2008, Rick Delaney wrote:
> >
> > It would make more sense if it was a configuration option of the
> > template engine itself.  Then you wouldn't need the extension when
> > putting the template in the stash and things like
> >
> >     [% INCLUDE "path/to/my/template.tt2" %]
> >
> > wouldn't need to specify the ugly extension either.
> 
> You can do all of these things in your own app.  Why do you feel the
> need to inflict this on other people?  Adding a bunch of weird
> configuration options seems wasteful when you can just write a line or
> two of code to customize things exactly as you need.
> 
> The reason you have a subclass of a View in your application is so you
> can do whatever you want.

I think maybe you didn't understand what I wrote.  I'm not trying to
inflict anything on anyone, except maybe the maintainers of Template
Toolkit.  If I could do something like 

    my $t = Template->new({ SEARCH_EXTENSION => '.tt2' });

then I could write

    $t->process("mytemplate"); # finds mytemplate.tt2

and within templates

    [% INCLUDE "othertemplate" %]

which would find 'othertemplate.tt2'.

I think the way Catalyst::View::TT is handling extensions is fine.  But
I think the functionality of extension handling belongs in TT itself and
then Catalyst wouldn't need to deal with it at all.  The same goes for
any other Template engine, too.

Or maybe you did understand what I wrote but believe there is such an
option that I can specify in my View subclass.  If there is, I would
very much like to know what it is.

-- 
Rick Delaney
rick at bort.ca



More information about the Catalyst mailing list