in reply to Trying to understand template-foo

Hi, I think I talked to you on the Class::DBI mailing list. I just wrote up a big long response and then lost it when I accidentally closed the browser. I don't have the patience to type it all in again, but here are the major points:

To answer your question about CSS, it's mostly irrelevant. The templates can contain any HTML you want including CSS. The important thing is that they only get to look at the data, not change any of it.

I hope that gets you started. If you come to a New York Perl Mongers meeting I can show you how to do it in detail.

Replies are listed 'Best First'.
Re: Re: Trying to understand template-foo
by jest (Pilgrim) on Sep 16, 2003 at 17:58 UTC

    Thanks to all who replied; I've been considering everyone's comments and it's all been helpful. Which isn't to say that I now know exactly what I'm doing....

    For now I followed mostly Perrin's advice, and rewrote the included code to instead generate a complex data structure that I passed to a Template Toolkit template. I kept all the summary calculations in the Perl, so the only programming-ish things in the template were FOREACH loops and a few conditionals to handle things like the alternate-colored lines and such.

    It works perfectly, i.e. exactly the same as it was before but more modifiable. I must say that I still feel a little uncomfortable with it--the programming in the template, while hardly complex, is still programming, and it's distracting to have a different way of handling looping, comparisons, and data structures. But I'm learning, and TT has so much neat stuff that I concede it's probably worthwhile to know more about it in the long run.

    Thanks again for the ideas. Next stop, on to Class::DBI!