[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cgiapp] RE: OT: Class::DBI passing data to templates


On Fri, 5 Nov 2004 21:59:04 -0800, Charlie Piper <suppressed> wrote:
> I've also been thinking about using Class::DBI with HTML::Template as well.
> I like the idea of #1 but how do you handle has_a and has_many
> relationships?  Browsing the Class::DBI pod I would imagine that the has_a
> would "do the right thing" but I'm not sure how you would handle has_many
> with H::T and loops.

has_a and had_many are another good reason to look at Template
Toolkit.  The two work really well together.  A good example of how
powerful Class::DBI and Template Toolkit can be is in this perl.com
article by Kake Pugh.  It is aptly named "How to avoid writing code".

http://www.perl.com/pub/a/2003/07/15/nocode.html

Using Template Toolkit in CGI::Application is really easy with the
CGI::Application::Plugin::TT plugin.  And Class::DBI doesn't really
need a plugin to work well with CGI::Application...

Sorry for providing a post that doesn't really answer your question
about HTML::Template, but I don't think there is a really good answer
for using has_many and has_a with HTML::Template besides dumping all
the data into arrays of hashes...

Cheers,


-- 
Cees Hek

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/suppressed/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.