Template

NAME

HTML::Template - A simple templating system based on the HTML::Template of Perl 5

SYNOPSIS

eg/index.raku looks like this:

use v6.c;
use HTML::Template;
my %params = (
    title => 'Hello Perl 6 world',
    authors => Array.new(
      { name => 'Ilya'   },
      { name => 'Moritz' },
      { name => 'Lyle'   },
      { name => 'Carl'   },
      { name => 'Johan'  },
    ),
  );
my $ht = HTML::Template.from_file("templates/index.tmpl");
  $ht.with_params(%params);
  print $ht.output;

eg/templates/index.tmpl looks like this:

<html><head><title><TMPL_VAR title></head>
  <body>
  <h1><TMPL_VAR title>
<ul>
  <TMPL_LOOP authors>
    <li><TMPL_VAR name></li>
  </TMPL_LOOP>
  </ul>
<TMPL_IF error>
   <div id="error">Some error happened</div>
  </TMPL_IF>
</body>
  </html>

AUTHOR

Carl Masak

HTML::Template v0.0.1

A simple almost-port of CPAN's HTML::Template to Raku

Authors

    License

    Dependencies

    Test Dependencies

    Provides

    • HTML::Template
    • HTML::Template::Grammar
    • Text::Escape

    Documentation

    The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.