in reply to HTML::Template - loop order

Problem one is already solved above. Problem two is very solvable as well. You really have a few options. Sure you can switch templating systems to one that has more control of the data -- but to me that puts you on a slippery slope. It makes it easy for you to one off break the barrier of model-view-controller design. I would have my templates show the data and form the data in the right order etc in my code. Have some sort of flag that sets how data is sorted on the screen you are working on and expose the data to the template pre sorted in that way. Once you start tossing code in your templates they become much less valuable to you.


-Waswas

Replies are listed 'Best First'.
Re^2: HTML::Template - loop order
by tinita (Parson) on Aug 04, 2004 at 08:02 UTC
    i absolutely agree to do as much as possible in the code and not in the template. the more possibilities the template has, the more you are tempted to use them, i guess.

    but setting the order of items (not something more complicated like 'sortby column ...') sounds like something to me that the html designer can have control over.

    but i could also make the sort order an option which as to be set for the 'View'. mmh, difficult. i'll decide later =)