Just adding information to a very, very old thread from June 2006 that I
now finally (!) got round to address:
Darren Chamberlain wrote:
* Robert Hicks <[EMAIL PROTECTED]> [2006/06/11 19:38]:
What about making an alias? loop.final?
That seems like a good idea. :-)
It should be as simple as:
Index: lib/Template/Iterator.pm
===================================================================
RCS file: /template-toolkit/Template2/lib/Template/Iterator.pm,v
retrieving revision 2.68
diff -u -r2.68 Iterator.pm
--- lib/Template/Iterator.pm 2006/05/30 15:53:11 2.68
+++ lib/Template/Iterator.pm 2006/06/12 02:02:09
@@ -207,6 +207,7 @@
# alias NUMBER to COUNT for backwards compatability
$item = 'COUNT' if $item =~ /NUMBER/i;
+ $item = 'LAST' if $item eq 'final';
return $self->{ uc $item };
}
Untested, though.
(darren)
The problem that I had posted back then was that loop.last didn't work
in TT2 with the "anycase" option enabled. Darren suggested "final" as an
alias, which however didn't work because "final" seems to be reserved
internally for another purpose. I now added the alias "loop_final" (for
want of a better word) instead, and this works.
Very belated thanks for pointing out the right location in Iterator.pm!
Best regards,
Birgit
_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates