>>>>> "pilsl" == pilsl <[EMAIL PROTECTED]> writes:
pilsl> On Wed, Apr 02, 2003 at 11:37:28AM -0500, Brett Sanger wrote: >> >> Frankly, I'm not a big fan of a lot of the examples in the >> documentation. They do a lot of things I would thwak anyone here for >> trying (DBI in templates is a No-no! Ditto for CGI.) They do a lot >> more math and contortions than I'd recommend. (Of course, I haven't >> offered alternative docs, so take my criticism in the spirit intended). >> pilsl> How do you solve the DBI-thing ? I am planning to use the toolkit in pilsl> the future instead of our own homemade template-system. The very pilsl> essential part of this templatesystem is easy DBI-access. Our webapps pilsl> contain merely data from sql-databases spread over many different pilsl> tables and even different databases. pilsl> Why do you consider DBI an no-no anyway ? DBI in a template is merely mid-way along the sliding scale from "pure templates" to "[% PERL %] in templates". It just depends on how pure you want to be. One way to get DBI out of templates is to write a plugin that really does the heavy lifting out in Perl-space, returning an object of exactly the right shape to be exploited by the Template rendering code. Another way is to have Perl drive instead of Template driving, calling Template rendering pieces from inside the DBI-access code. Or did I misunderstand the "no-no" there? There's no "right" way to use a templating system (depends on your application and goals), and one of the nice things I like about TT is just how freakin' flexible and pluggable it is, so that it can be used in practically any model. Truly lives up to its name of "toolkit". -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <[EMAIL PROTECTED]> <URL:http://www.stonehenge.com/merlyn/> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training! _______________________________________________ templates mailing list [EMAIL PROTECTED] http://lists.template-toolkit.org/mailman/listinfo/templates
