[Templates] Loop VMethods docpatch
Cees Hek
ceeshek@gmail.com
Fri, 9 Feb 2007 09:24:44 +1100
On 2/8/07, Hakim Cassimally <hakim.cassimally@gmail.com> wrote:
> A patch for Template/Manual/VMethods.pod follows,
>
> - osfameron
>
> --- VMethods.pod 2007-02-08 10:24:07.000000000 +0100
> +++ VMethods.pod.patch 2007-02-08 10:39:04.000000000 +0100
> @@ -424,6 +424,18 @@
>
> =back
>
> +=head2 Iterator Virtual Methods
> +
> +There are virtual methods that can be called on the iterator
> variable, for example
> +to check if it is the first or last item, an odd or an even item, etc.
> +
> + [% FOREACH i = list %]
> + [% IF i.first() %] First Line [% END %]
Shouldn't that be loop.first, not i.first?
Cheers,
Cees
> + ....
> + [% END %]
> +
> +These are documented fully under L<Template::Manual::Directives/Loop
> Processing>.
> +
> =head2 Automagic Promotion of Scalar to List for Virtual Methods
>
> In addition to the scalar virtual methods listed in the previous
>
> _______________________________________________
> templates mailing list
> templates@template-toolkit.org
> http://lists.template-toolkit.org/mailman/listinfo/templates
>