1 #============================================================= -*-Perl-*-
3 # Template::Plugin::Iterator
7 # Plugin to create a Template::Iterator from a list of items and optional
8 # configuration parameters.
11 # Andy Wardley <abw@wardley.org>
14 # Copyright (C) 2000-2007 Andy Wardley. All Rights Reserved.
16 # This module is free software; you can redistribute it and/or
17 # modify it under the same terms as Perl itself.
19 #============================================================================
21 package Template::Plugin::Iterator;
25 use base 'Template::Plugin';
26 use Template::Iterator;
30 #------------------------------------------------------------------------
31 # new($context, \@data, \%args)
32 #------------------------------------------------------------------------
37 Template::Iterator->new(@_);
46 Template::Plugin::Iterator - Plugin to create iterators (Template::Iterator)
50 [% USE iterator(list, args) %]
52 [% FOREACH item = iterator %]
53 [% '<ul>' IF iterator.first %]
55 [% '</ul>' IF iterator.last %]
60 The iterator plugin provides a way to create a L<Template::Iterator> object
61 to iterate over a data set. An iterator is implicitly automatically by the
62 L<FOREACH> directive. This plugin allows the iterator to be explicitly created
67 Andy Wardley E<lt>abw@wardley.orgE<gt> L<http://wardley.org/>
71 Copyright (C) 1996-2007 Andy Wardley. All Rights Reserved.
73 This module is free software; you can redistribute it and/or
74 modify it under the same terms as Perl itself.
78 L<Template::Plugin>, L<Template::Iterator>
84 # perl-indent-level: 4
85 # indent-tabs-mode: nil
88 # vim: expandtab shiftwidth=4: