HTML::Template::HashWrapper

Easy association with HTML::Template
Download

HTML::Template::HashWrapper Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Greg Fast
  • Publisher web site:
  • http://search.cpan.org/~gregfast/

HTML::Template::HashWrapper Tags


HTML::Template::HashWrapper Description

Easy association with HTML::Template HTML::Template::HashWrapper is a Perl module that provides a simple way to use arbitrary hash references (and hashref-based objects) with HTML::Template's associate option.new($ref) returns an object with a param() method which conforms to HTML::Template's expected interface: * param($key) returns the value of $ref->{$key}. * param() with no argument returns the set of keys. * param($key,$value) may also be used to set values in the underlying hash.new() will die if given something which is not a hash reference as an argument.The object returned by $new retains its identity with its original class, so you can continue to use the object as normal (call its methods, etc).SYNOPSIS use HTML::Template; use HTML::Template::HashWrapper; my $context = { var1 => 'Stuff', var2 => , }; my $template = HTML::Template->new ( associate => HTML::Template::HashWrapper->new( $context ) ); # Some::Object creates blessed hash references: my $something = Some::Object->new(); my $wrapper = HTML::Template::HashWrapper->new( $something ); my $template = HTML::Template->new( associate => $wrapper ); # the wrapper keeps the original's interface: my $val1 = $something->somemethod( 251 ); my $val2 = $wrapper->somemethod( 251 ); Requirements: · Perl


HTML::Template::HashWrapper Related Software