HTML::Template::HTX

Handle HTML Extension template (.htx) files
Download

HTML::Template::HTX Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Publisher Name:
  • Theo Niessink
  • Publisher web site:
  • http://search.cpan.org/~tale/

HTML::Template::HTX Tags


HTML::Template::HTX Description

Handle HTML Extension template (.htx) files The HTML::Template::HTX module reads and outputs HTML Extension template (.htx) files, which enable you to seperate your Perl code from HTML code.To use a .htx template file in your Perl script, basically follow these steps: 1. Create a new HTML::Template::HTX object. 2. Optionally define some parameters, and output the header of the template. 3. Optionally change or define some parameters, and output the detail section. This step is optionally repeated a number of times, depending on the data you're processing. 4. Optionally change or define some parameters, and output the footer of the template. 5. Close the template file, or destroy the HTML::Template::HTX object.If you don't have any repeated data, then you can skip steps 2 and 3, and just use print_footer to output the whole template file at once. If you have multiple sets of repeated data, then you should probably follow a slightly altered schema (see the detail_section method).SYNOPSIS use HTML::Template::HTX; $htx = HTML::Template::HTX->new('template.htx') or die "Oops!"; $htx->param('counter' => 0); $htx->print_header(1); foreach(qw(I used to care but Things Have Changed)) { $htx->param( 'counter' => $htx->param('counter')+1, 'Name' => $_, ); $htx->print_detail; } $htx->print_footer; $htx->close;template.htx < HTML >< HEAD >< TITLE >Sample results< /TITLE > < /HEAD >< BODY > < H2 >Sample results:< /H2 > < gindetail% > < %counter% >. < %Name% >< BR > < %enddetail% > < /BODY >< /HTML > Requirements: · Perl


HTML::Template::HTX Related Software