Jonas Liljegren <[EMAIL PROTECTED]> said something to this effect on 08/16/2001:
> > > Write your own Apache::Template.
> > 
> > I want to understand how/why Andy did it the way he did, and I want
> > to know how to subclass it.
> 
> It would take more code to subclass than to just rewrite it.  You
> could use one like this:
> 
> package My::Handler;
> my $th = Template->new( INCLUDE_PATH => $r->document_root );
> sub handler
> {
>     my $r = shift;
>     my $me = $r->uri;
>     $me =~ s[^/][];
>     $th->process($me, {}, $r ) or die $th->error;
> }
> 1;
> 
> There is so many ways to do things.  It quickly becomes complex if you
> try to create something general...  I'm lookin ag Apache::Template now
> and thinks that that module makes things look more difficult than they
> are.

If you are interested in looking at Another Way To Do It, take a
look at my Apache::TT2 module, which is not on CPAN (yet?) but is
available on sourceforge at http://sourceforge.net/projects/apache-tt2/.

It works very similarly to Apache::Template, and is based on the
Grover module that I submitted to Andy a few months ago.

At boston.com, we are using Apache::TT2 in one of our subsites,
and are planning on using it more as we rearchitect our other
subsites.  It is stable and fast (mostly due to a lot of caching
of compiled templates on big-ass machines), and has very few
problems (although it is mostly unoptimized and does some silly
things in places).

Go ahead and take a look at it.  The latest tarball is at
http://prdownloads.sourceforge.net/apache-tt2/Apache-TT2-1.24.tar.gz.

(darren)

-- 
It is impossible to sharpen a pencil with a blunt axe. It is equally vain
to try to do it with ten blunt axes instead.
    -- E. W. Dijkstra


Reply via email to