TT's new takes a hashref or a hash
[scpubgit/HTML-String.git] / lib / HTML / String / TT.pm
1 package HTML::String::TT;
2
3 use strictures 1;
4 use Template;
5 use Template::Parser;
6 use Template::Stash;
7 use HTML::String::TT::Directive;
8
9 sub new {
10     shift;
11     Template->new(
12         PARSER => Template::Parser->new(
13             FACTORY => 'HTML::String::TT::Directive'
14         ),
15         STASH => Template::Stash->new,
16         (ref($_[0]) eq 'HASH' ? %{$_[0]} : @_)
17     );
18 }
19
20 1;