in reply to Re^2: HTML::Template::Compiled - TMPL_EACH
in thread HTML::Template::Compiled - TMPL_EACH

Hi there,

You could have something like:

<%each hash sort=num reverse=1 %>

Meaning that by default it wouldn't reverse.

The solution of having sort=num or alpha looks good to me.

Replies are listed 'Best First'.
Re^4: HTML::Template::Compiled - TMPL_EACH
by tinita (Parson) on Sep 06, 2008 at 02:26 UTC
    or how about
    <%each hash sort=-num %>
    less typing =)

    edit: on the other hand, an attribute 'reverse' could also be used for tmpl_loop

      In my oppinion when you use TMPL_LOOP you already took care of sorting when you build the array to feed the TMPL_LOOP.

      Any of both solutions looks fine to me.