[Templates] Re: loop.first, loop.last

Darren Chamberlain dlc@sevenroot.org
Sun, 11 Jun 2006 22:04:20 -0400


--1C2QhcYtVTlNtC1j
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

* Robert Hicks <sigzero@gmail.com> [2006/06/11 19:38]:
> > What about making an alias?  loop.final?
>=20
> That seems like a good idea.  :-)

It should be as simple as:

Index: lib/Template/Iterator.pm
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
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 @@
=20
     # alias NUMBER to COUNT for backwards compatability
     $item =3D 'COUNT' if $item =3D~ /NUMBER/i;
+    $item =3D 'LAST' if $item eq 'final';
=20
     return $self->{ uc $item };
 }

Untested, though.

(darren)

--=20
Don't be ashamed to say what you are not ashamed to think.

--1C2QhcYtVTlNtC1j
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFEjMukzsinjrVhZaoRAkdEAJ9lRyGUL8ZhAh6OrPDAd0tWR5aZAwCfVTgx
mjkfqr1Odso15LK4Mq4BUIw=
=dw8k
-----END PGP SIGNATURE-----

--1C2QhcYtVTlNtC1j--