[Templates] Re: loop.first, loop.last
Buddy Burden
buddy@thinkgeek.com
Mon, 12 Jun 2006 13:14:30 -0400
Guys,
>>> What about making an alias? loop.final?
>> That seems like a good idea. :-)
> It should be as simple as:
> :
> :
>
> Untested, though.
Or, if you don't like modifying TT2 code, something like this could work:
# file: My/Iterator.pm
package My::Iterator;
use strict;
use warnings;
use base qw<Template::Iterator>;
$Template::Config::ITERATOR = qw<My::Iterator>;
sub final { my $this = shift; return $this->last(@_); }
1;
Also untested.
-- Buddy