in reply to Re: HTML::Template - loop order
in thread HTML::Template - loop order

turn on loop_context_vars and use __last__
great, thanks. saved my day =)
next time i'll read the docs more carefully

Replies are listed 'Best First'.
Re^3: HTML::Template - loop order
by ccn (Vicar) on Aug 03, 2004 at 19:02 UTC

    concerning the second problem I can suggest two ways

    • If you can use unique names for you LOOPs in a html, then you may use global vars like "SOMENAME_REVERSED" in the begin of html not inside of deep structures
    • If your LOOPs are not huge then you may provide the both direct and reversed representations of the list for each LOOP. e.g. <TMPL_LOOP NAME='NAME'> and <TMPL_LOOP NAME='NAME_REVERSED'>. So you don't need to detect anything
      If you can use unique names for you LOOPs ...
      yes, i actually can (but in this early stage i might redesign the whole thing...). but that's a nice idea. then i don't need to query() the template just need to query the template once.
      If your LOOPs are not huge then
      that's something i don't know. the code should be good for any kind of data. but that might be a good candidate for an option like use MyModule qw(auto_reverse) or something.