possible to alias nsort and sort / assign it to a var
Summer <crazysummer2004-/[email protected]> Mon, 8 Jul 2013 23:31:02 -0700 (PDT)
| Newsgroups | gmane.comp.lang.perl.modules.template-toolkit |
|---|---|
| Message-ID | <[email protected]> |
Hey All, Here is my issue. I have some TT code and want to try to make it uniform across two different possible UI views. As such, one view requires nsort() of data, the other sort(). As such, I was hoping I could just do something like: newSort = if_conditional ? nsort() : sort(); FOREACH item IN someItems.keys.newSort; or perhaps: newSort = if_conditional ? nsort : sort; FOREACH item IN someItems.keys.$newSort(); This way, I don't have to do a giant if/else to accomodate my difference in sorting. Thanks. _______________________________________________ templates mailing list [email protected] http://mail.template-toolkit.org/mailman/listinfo/templates