Template::HTML::Stash - A replacement for Template::Stash that wraps the get method


Template-HTML documentation Contained in the Template-HTML distribution.

Index


Code Index:

NAME

Top

Template::HTML::Stash - A replacement for Template::Stash that wraps the get method

SYNOPSIS

Top

  use Template::HTML;

  my $config = {
      # See Template.pm
  };

  my $template = Template::HTML->new($config);

  my $vars = {
      var1  => $value,
      var2  => \%hash,
      var3  => \@list,
      var4  => \&code,
      var5  => $object,
  };

  # specify input filename, or file handle, text reference, etc.
  my $input = 'myfile.html';

  # process input template, substituting variables
  $template->process($input, $vars)
      || die $template->error();

DESCRIPTION

Top

This is a subclass of Template::Stash (the Template Toolkit stash module). It wraps all get calls and returns an HTML::Template::Variable instead of the raw string.

SEE ALSO

Top

http://git.dollyfish.net.nz/?p=Template-HTML

FUNCTIONS

Top

get()

An overridden function from Template::Stash that calls the parent classes get method, and simply returns an Template::HTML::Variable instead of a raw string.

AUTHOR

Top

Martyn Smith, <msmith@cpan.org>

COPYTIGHT AND LICENSE

Top

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.


Template-HTML documentation Contained in the Template-HTML distribution.

package Template::HTML::Stash;

use strict;
use warnings;
use base qw(Template::Stash);
use Template::HTML::Variable;


sub get {
    my $self = shift;

    my $value = $self->SUPER::get(@_);

    $value = Template::HTML::Variable->new($value);

    return $value;
}

1;
__END__