in reply to HTML::Template, DBI and <TMPL_LOOP>'s

Was there a question? Regardless, i just wanted to point out that i did not know about the fetchall_arryref trick until gmax informed me at (jeffa) Re: A quesion about referencing lists. I have since contemplated updating HTML::Template Tutorial, but i haven't because i have instead have been contemplating writing Part 2 (and defecting over to Template). For the record, though, i do spread the gospel when i can. ;)

For me, the brilliance in this technique is only having to specify the column names in two places: in the SQL query and in the template. (Compare this with PostNuke's standard of having to list out the column names like 5 or 6 times in different areas of code ... bleh :/)

UPDATE:
commented out code snippet, it is now in root node

UPDATE:
So that's how you coerce selectall_arrayref! dkubb++ ... i wish i could transfer all of the XP from this node over to yours for that! ;)

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

Replies are listed 'Best First'.
Re: Re: HTML::Template, DBI and <TMPL_LOOP>'s
by jdtoronto (Prior) on Jan 03, 2004 at 02:51 UTC
    jeffa

    Was there a question?

    um, no! Maybe this should have been a meditation or a snippet. I hope you don't mind that I pinched your very much simplified code example. I was writing this in the heat of a busy morning and just wanted to get it all down before I got interupted again.

    Pressure of time has kept me from looking at TT/TT2 so I look forward to your tutorial on that as well, it may influence me for the future. I have got all the TT2 stuff installed but every time I look at the doc's I head straight back to HTML::Template.

    John jdtoronto

      The one thing that really "won me over" was the WRAPPER directive. I so want this feature in HTML::Template, but i fear that some heavy lifting will be required to add it ... anyways, WRAPPER allows you to contain a "header" and a "footer" in one file. This is incredibly useful. Imaging that you have a skeleton ... oh wait a second! I've already explained this once before to you at Re: HTML::Template question. :D

      Go back and look at that example again. You may ask yourself, "well, there is a complete script for the H::T example, but where is the code for TT the example?" First, my apologies for not explaining ... second, try this:

      1. save the first template as skeleton.html
      2. save the two pages as page1.html and page2.html, respectively
      3. type tpage page1.html in your shell
      If you have all the TT2 stuff installed correctly that should work just fine. Neat, eh?

      If you want a skeleton Perl script to work with, try this one on for size:

      HTML::Template is simpler and faster, but TT is more fun and extremely powerful. ;)

      jeffa

      L-LL-L--L-LL-L--L-LL-L--
      -R--R-RR-R--R-RR-R--R-RR
      B--B--B--B--B--B--B--B--
      H---H---H---H---H---H---
      (the triplet paradiddle with high-hat)