It appears that neither query() param() return the list of parameters
in the order that they appear in the template file. (Example below.)
How can I do this? Am I missing a special option or a feature?
Is this a desired feature that would be welcomed into HTML::Template?
Do @pstack and %pmap in &_parse() of HTML/Template.pm keep the order
information stored so that we could easily add this functionality?
Or should I just work around this in my application by parsing the
template file first myself to determine the order of the fields.
Thanks, Brandon
For an example of the current ordering, given this template:
---------template loopsOrder.tmpl--------
<html>
<title><!-- TMPL_VAR NAME=pagetitle --></title>
<body>
<p><!-- TMPL_VAR NAME=bodytop --></p>
<!-- TMPL_LOOP NAME=bodysections -->
<p>
<strong><!-- TMPL_VAR NAME=sectiontitle --></strong><br>
<!-- TMPL_VAR NAME=sectiontoptext --><br>
<!-- TMPL_LOOP NAME=officers -->
<u><!-- TMPL_VAR NAME=officertitle --></u>: <!-- TMPL_VAR
NAME=officername --><br>
<!-- /TMPL_LOOP -->
<!-- /TMPL_LOOP -->
<p><!-- TMPL_VAR NAME=bodybottom --></p>
</body></html>
---------/template loopsOrder.tmpl--------
I get the following list of parameters:
---------output--------
Params from query() are:
bodysections
bodytop
pagetitle
bodybottom
Params from param() are:
bodysections
bodytop
pagetitle
bodybottom
---------/output--------
when I run this little program to examine query() and param():
---------program loopsOrder.pl--------
#!/usr/bin/perl
use HTML::Template;
my $template = HTML::Template->new(filename => 'loopsOrder.tmpl');
my @queryParams = $template->query();
my @paramParams = $template->param();
print "Params from query() are:\n ";
print join "\n ", @queryParams;
print "\n";
print "Params from param() are:\n ";
print join "\n ", @paramParams;
print "\n";
---------/program loopsOrder.pl--------
Whereas I really want the list to come out in this order:
pagetitle
bodytop
bodysections
bodybottom
--
Brandon Bowersox
[EMAIL PROTECTED]
OJC Technologies, Inc.
www.ojctech.com, 217-278-3933
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
Html-template-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/html-template-users