mhearse has asked for the wisdom of the Perl Monks concerning the following question:
TEMPLATE:sub table_data { my $self = shift; my @outer_loop; for (my $row = 0; $row <= @{$self->{selection}}; $row++) { my %hash; $hash{table_data_begin_row} = q{<fo:table-row>}; my @inner_loop; for (my $col = 0; $col <= @{$self->{selectionAttr}}; $col++) { my %hash; $hash{table_data} = $self->{selection}[$row][$col]; push @inner_loop, \%hash; } $hash{table_data_close_row} = q{</fo:table-row>}; $hash{table_data} = \@inner_loop; push @outer_loop, \%hash; } $self->{tmpl_obj}->param(table_data_loop => \@outer_loop); }
<fo:table-body> <TMPL_LOOP NAME=table_data_loop> <TMPL_VAR NAME=table_data_begin_loop> <TMPL_LOOP NAME=table_data> <fo:table-cell> <fo:block border-right-width="0.5pt" text-align="center" vertical-al +ign="middle"> <TMPL_VAR NAME=table_data> </fo:block> </fo:table-cell> </TMPL_LOOP> <TMPL_VAR NAME=table_data_close_loop> </TMPL_LOOP> </fo:table-body>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Help with nested loop in HTML::Template
by wfsp (Abbot) on Dec 22, 2007 at 10:59 UTC | |
|
Re: Help with nested loop in HTML::Template
by Rhandom (Curate) on Dec 22, 2007 at 19:24 UTC | |
by mhearse (Chaplain) on Dec 23, 2007 at 02:07 UTC |