UPDATE:use strict; use HTML::Template; my $data = do {local $/; <DATA>}; my $template = HTML::Template->new( scalarref => \$data, ); my $returnArray = [ { node_date => 'some date', node_author => 'some author', DisplayContent => 'DisplayContent', node_title => 'some title', node_content => 'some content', action_name => 'some_action', select_name => 'Type', options => [ {opt => 'Audit'}, {opt => 'New'}, {opt => 'Update'}, ], }, { node_date => 'some other date', node_author => 'some other author', DisplayContent => 'DisplayContent', node_title => 'some other title', node_content => 'some other content', action_name => 'some_other_action', select_name => 'Type', options => [ {opt => 'Audit'}, {opt => 'New'}, {opt => 'Update'}, ], }, ]; $template->param( NEWBODY => $returnArray ); print $template->output; __DATA__ <TMPL_LOOP NAME=NEWBODY> <P CLASS="std-title"><STRONG>Date</STRONG>: <TMPL_VAR NAME=node_date>< +BR> STRONG>By</STRONG>: <TMPL_VAR NAME=node_author> <P> <TMPL_VAR NAME=DisplayContent> <FORM ACTION="modify.pl" METHOD="POST"> <TABLE BORDER=0 CELLSPACING=1 CELLPADDING=1> <TR><TD>Title</TD> <TD><INPUT TYPE="TEXT" SIZE=100 NAME=node_title value="<TMPL_VAR NAME= +node_title>"></TD> </TR> <TR> <TD COLSPAN=2> <TEXTAREA COLS=100 ROWS=20 NAME=node_content><TMPL_VAR NAME=node_conte +nt></TEXTAREA> </TD> </TR> <TR><TD><INPUT TYPE="SUBMIT" NAME=action_name VALUE="<TMPL_VAR NAME=ac +tion_name>"></TD></TR> <TD><INPUT TYPE="RESET" VALUE="Reset"></TD> </TR> </TABLE> <SELECT NAME="<TMPL_VAR NAME=select_name>"> <TMPL_LOOP NAME="options"> <OPTION><TMPL_VAR NAME="opt"></OPTION> </TMPL_LOOP> </SELECT> </FORM> </TMPL_LOOP>
<html> <body> <tmpl_var foo> <tmpl_loop bar> <tmpl_var baz> <tmpl_var qux> </tmpl_loop> </body> </html>
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
In reply to (jeffa) Re: TMPL_LOOP within a TMPL_LOOP
by jeffa
in thread TMPL_LOOP within a TMPL_LOOP
by shockme
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |