I agree with Dan. I pretty much only use Template Toolkit, so for new
projects, I use CAP::TT as often as I use CAP::AnyTemplate. They both
work well. So, I'd say: use whatever feels right.
There are only in a handful of specific cases where there's a clear
reason for a TT user to pick CAP::AnyTemplate over CAP::TT:
* You want to distribute your app, and you want to let the end users
pick their own templating systems (like CGI::Application::Search
does)
* You are migrating a large set of apps to TT and you want to take
your time with the templates.
* You want to use CAP::AnyTemplate's embedded components feature
* You think you might want to experiment with Petal eventually
CAP::AnyTemplate was originally written to settle the "my templating
system is better than your templating system" argument. From the
application's point of view, template systems all look the same, so why
shouldn't they all have the same API? I still think it's good idea.
(Interestingly the totally unrelated Any::Template project was released
at almost the same time as CAP::AnyTemplate, and had the same goal.)
The migration feature of CAP::AnyTemplate was a nice side effect - I'm
glad others are getting some use out of that one.
I've been using it over the last year to migrate a largish system from
homegrown technologies over to CGI::Application + Template Toolkit.
The old system had its own web controller and its own homegrown
templating system.
So I wrote a CAP::AnyTemplate driver for the homegrown templating
system. This let us convert all the apps to CGI::Application without
having to also convert all the templates at the same time. Now that
the applications have all been ported, we can convert the templates at
a more leisurely pace on a case by case basis (e.g. when we need a TT
feature that the old system doesn't support).
Michael
On Thu, 21 Sep 2006 14:50:44 +1200
"Dan Horne" <[EMAIL PROTECTED]> wrote:
> I'm not sure if this is useful, but here are my two cents:
>
> I use CAP::AnyTemplate with both HTML::Template::Expr and TT in an
> existing app so that I can transition existing templates from the
> former to the latter. I have found it to be an excellent tool (thanks
> Michael!), but will probably go straight to CAP::TT for all new apps.
> Now that I'm doing everything in TT, I no longer need to have a
> middle layer abstracting the differences between the different
> templating systems. If you don't intend to use H::T::* or Petal, you
> probably won't get any benefit from CAP::AnyTemplate.
>
> Dan
>
>
>
> > -----Original Message-----
> > From: Cees Hek [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, 21 September 2006 2:29 p.m.
> > To: [EMAIL PROTECTED]
> > Cc: [email protected]
> > Subject: Re: [cgiapp] CGI::Application::Plugin::AnyTemplate
> > vs. CAP::TT
> >
> > I noticed that no one answered this question. I am not
> > really the right one to answer it, since I use CAP::TT
> > exclusively. Does anyone else have any comments?
> >
> > Cheers,
> >
> > Cees
> >
> > On 9/15/06, George Hartzell <[EMAIL PROTECTED]> wrote:
> > >
> > > I'm just getting started w/ CGI::Application, and am pretty
> > > excited.
> > >
> > > I'm using the Template Toolkit.
> > >
> > > It seems to me that it's a good idea to use CAP::AnyTemplate
> > > since that gives me the flexibility to change templating systems.
> > >
> > > I've noticed that several of the plugins (HTMLPrototype,
> > > DevPopup, MessageStack, others?) seem to do special things when
> > working with the
> > > TT templates, but they all refer to CAP:TT.
> > >
> > > Will I loose their special functionality if I use
> > AnyTemplate? Can I
> > > "use" both TT and AnyTemplate, then do my stuff in
> > AnyTemplate and let
> > > the other libs use the TT interface?
> > >
> > > Is there something that the TT plugin does that the AnyTemplate
> > > couldn't be extended to do if someone added the necessary tuits?
> > >
> > > Thanks,
> > >
> > > g.
> > >
> > >
> > ---------------------------------------------------------------------
> > > Web Archive:
> > > http://www.mail-archive.com/[email protected]/
> > > http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2 To unsubscribe,
> > > e-mail: [EMAIL PROTECTED] For additional
> > > commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > Web Archive: http://www.mail-archive.com/[email protected]/
> > http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> ---------------------------------------------------------------------
> Web Archive: http://www.mail-archive.com/[email protected]/
> http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
--
Michael Graham <[EMAIL PROTECTED]>
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/[email protected]/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]