pass args to ::TT along to all the manually instantiated Template components.
[scpubgit/HTML-String.git] / lib / HTML / String / TT.pm
index 0244de8..f132071 100644 (file)
@@ -30,17 +30,19 @@ BEGIN {
 
 sub new {
     shift;
+    my @args = (ref($_[0]) eq 'HASH' ? %{$_[0]} : @_);
     Template->new(
         PARSER => Template::Parser->new(
-            FACTORY => 'HTML::String::TT::Directive'
+            FACTORY => 'HTML::String::TT::Directive',
+            @args,
         ),
-        STASH => Template::Stash->new,
+        STASH => Template::Stash->new( @args,),
         FILTERS => { no_escape => sub {
             $_[0]->$_isa('HTML::String::Value')
                 ? HTML::String::Value->new(map $_->[0], @{$_[0]->{parts}})
                 : HTML::String::Value->new($_)
         } },
-        (ref($_[0]) eq 'HASH' ? %{$_[0]} : @_)
+        @args,
     );
 }