On Thu, Apr 03, 2003 at 03:53:21PM +0200, Hans Juergen von Lengerke wrote: > > When you use TT your system usually contains two types of > sources, a) templates and b) perl code. Brett is simply > saying the DBI stuff does not belong into the templates, but > rather in the perl code. The perl code then makes the > results from DBI calls available to templates through the > replace hash. Like this, you have full 'perl control' over > your data before it is being dispatched to the presentation > layer (templates). > > If you were to make the DBI calls from within the TT DBI > plugin and you have to change that data somehow later, then > you have to start writing business logic in your templates, > and that may not the place where you want it, because your > templates are often being maintained by non-programmers. > > HTH, Hans >
Thnx - that finally helped to find my essential question: if using a system like toolkit for a big webapplication I need to implement the whole pagestructure twice: on one hand I need to implement the templates and its structure and on the other hand I need to develop the same structure in the calling perl-tool. example : I have two different pages gathering data from different databases. So I need two templates and in the calling script I need two different database-selects that needs to be processed depening on the call. I fear that in real-life this will create confusing hard-to-read perlscripts. If you have a big project with 50 different types of pages you need to implement 50 queries in one script or create 50 different scripts. Somehow it seems to me that it would be a good idea to have the queries in the templates. How do you all deal with this ? Just writing a monstrous perlscript or many small ones ? Or do you create a big library of functions that are than all passed to all templates and the template picks the needed one ? In our current system each template contains of two seperated parts: * the html-template * some perlfuncs that are relevant to this template. This solution seems not so bad to me.... What I see now is that the templates itself are easy to maintain with TT while other systems that allow perlcode in the templates help to keep the structure of the whole page. Now the question is : which one is more important to me ? :) thnx, peter -- mag. peter pilsl IT-Consulting tel: +43-699-1-3574035 fax: +43-699-4-3574035 [EMAIL PROTECTED] http://www.goldfisch.at _______________________________________________ templates mailing list [EMAIL PROTECTED] http://lists.template-toolkit.org/mailman/listinfo/templates
