On Fri, Nov 25, 2005 at 01:18:37PM +0300, Vadim Kutchin said:
> And I want access to loop1s count() from loop2s. From documentation I
> understand - I must use Template::Plugin::Iterator, but it is not clear for
> me how.
> Can anybody explain?
You can take a local copy of the iterator
[% FOR a = [ 1, 2, 3 ] %]
[% outer = loop %]
[% FOR b = [ 'a', 'b', 'c' ] %]
[% inner = loop %]
1) [% outer.count %] => [% a %]
2) [% inner.count %] => [% b %]
[% END %]
[% END %]
prints
1) 1 => 1
2) 1 => a
1) 1 => 1
2) 2 => b
1) 1 => 1
2) 3 => c
1) 2 => 2
2) 1 => a
1) 2 => 2
2) 2 => b
1) 2 => 2
2) 3 => c
1) 3 => 3
2) 1 => a
1) 3 => 3
2) 2 => b
1) 3 => 3
2) 3 => c
_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates