On Thu, Jul 21, 2005 at 09:38:32AM -0500, Will wrote:
> Any suggestions? Could you explain to me how to best use these modules 
> together, or point me to some example already on the web?

There's a plugin for TT in CGI::Application.  There's also a number of
use that use a subclass of CGIApp as a baseclass for all of our
applications, in which case you can drop in some handy wrapper
functions.  For example, I have a method that dices up a given path,
and pushes the parts onto TT's INCLUDE list.  So if a given file isn't
found, it will check the next directory up.  This lets me create a
default set of templates for an application, then override one or more
of them in a subdirectory, and I can point any given instance script at
whichever set I want.  As my work involves many instances of the same or
similar applications, this greatly reduces repetition for me.  (Your
Mileage May Vary).

I also have my app put any cgiapp params that do not begin with _ into
the vars that are passed into TT.

I've only begun playing with Class::DBI, but so far TT's dot notation
makes it trivial to drop a CDBI object into the vars that are available
in a template and use them there.

My main recommendations would be to use TT for templating.  Push all
coding into the cgiapp module or a TT Plugin.  (And then push all coding
out of those into generic modules).  Write an app or two, and anything
repetative might be a candidate for bump up to a layer between your apps
and CGI::App.

My second recommendation would be to look into Data::FormValidator and
HTML::FillInForm.  Some CGI::App Plugins exist for those, but if you
don't like how the plugins work, it's not too hard to roll your own
implementations.  Between those 5 tools, I spend almost no time worrying
about anything except the coding of the exact functionality.  All DB,
HTML, and flow control issues are mostly dealt with.

If you're looking into alternatives, I've heard good things about both
Maypole and Catalyst.  Randall can make his case for CGI::Prototype as
well. :)

-- 
SwiftOne  /  Brett Sanger
[EMAIL PROTECTED]   

_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to