Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Re: Idiomatic way of getting from database result set to HTML::Template data structure?

by Anonymous Monk
on Mar 29, 2004 at 16:04 UTC ( [id://340649]=note: print w/replies, xml ) Need Help??


in reply to Re: Idiomatic way of getting from database result set to HTML::Template data structure?
in thread Idiomatic way of getting from database result set to HTML::Template data structure?

If I could use the Template::Toolkit, the whole thing would most certainly have been a view problem, and indeed a no-brainer.

HTML::Template is a lot more constrained in that regard, coping only with variables, conditionals and iterators.

Ta,
  • Comment on Re: Re: Idiomatic way of getting from database result set to HTML::Template data structure?

Replies are listed 'Best First'.
Re: Re: Re: Idiomatic way of getting from database result set to HTML::Template data structure?
by dragonchild (Archbishop) on Mar 29, 2004 at 16:11 UTC
    You're missing the point. Sorting may be easier with TT, but H::T just prints out what you give it. Sort it before you hand it off to the View section. In other words, inflate your data, then sort it, then hand it off.

    ------
    We are the carpenters and bricklayers of the Information Age.

    Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose

      I'm not missing the point at all! The whole point of my question was getting the structure in a pre-sorted form the HTML::Template can use.
        You're still missing the point I'm trying to make. The sequence of events should go something like this:
        1. Determine what constraints there are on the data
        2. Get the data
        3. Organize the data
        4. Sort the data
        5. Format the data

        Those steps (often) are handled by the following areas:

        1. WWW form and CGI handler/script
        2. DBI call
        3. The inflater function I gave you
        4. Another function which takes the results of the inflater. I did not write this, leaving it as an exercise for the reader
        5. HTML::Template and/or Template

        In other words, I did the conceptually-difficult part of your work for you. Now, I'm expecting you to take what I did and adapt it to your needs. Not unreasonable for free expert-level help, wouldn't you say?

        ------
        We are the carpenters and bricklayers of the Information Age.

        Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://340649]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2024-04-18 07:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found