kappa has asked for the wisdom of the Perl Monks concerning the following question:
The task at hands is simple. I have a page which includes several nearly identical html chunks (read as follows: a form with several groups of widgets for date input). I'd like (naturally) to <TMPL_INCLUDE> them, but I don't seem to be able by design. Those widgets must have different names.
The way I'll probably do it now:
And I'd like to just:my $tmpl = new HTML::Template filename => 'form.tmpl.html'; my $date = new HTML::Template filename => 'dateinput.tmpl.html'; $date->param(ctrl_name => 'start'); $tmpl->param(start_date => $date->output); $date->param(ctrl_name => 'end'); $tmpl->param(end_date => $date->output);
<TMPL_INCLUDE NAME='dateinput.tmpl.html' ctrl_name=start> ... <TMPL_INCLUDE NAME='dateinput.tmpl.html' ctrl_name=end>
Both ways are awkward and the second is also impossible with current HTML::Template.
Any suggestions?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: HTML::Template generic includes
by matija (Priest) on Mar 29, 2004 at 15:24 UTC | |
by kappa (Chaplain) on Mar 29, 2004 at 15:42 UTC | |
|
Re: HTML::Template generic includes
by amw1 (Friar) on Mar 29, 2004 at 15:13 UTC |