diff Lib/IMPL/Web/View/TTFactory.pm @ 289:85572f512abc

*TTView refactoring
author cin
date Wed, 20 Feb 2013 02:25:30 +0400
parents 3a9cfea098dd
children 7b0dad6117d5
line wrap: on
line diff
--- a/Lib/IMPL/Web/View/TTFactory.pm	Tue Feb 19 19:58:27 2013 +0400
+++ b/Lib/IMPL/Web/View/TTFactory.pm	Wed Feb 20 02:25:30 2013 +0400
@@ -49,13 +49,13 @@
     
     $this->context->localise();
     
-    my $ctx = new Template::Context({ %{$this->context} });
+    my $ctx = _clone_context($this->context);
     
     $this->context->delocalise();
     
     my $stash = $ctx->stash;
     my $require = $this->require;
-
+    
     $stash->update({
         require => sub {
             my ($module) = @_;
@@ -65,7 +65,7 @@
         }        
     });
     
-    return ($name, $this->template, $ctx, hashApply({ factory => $this },$refProps));
+    return ($name, $this->template, $ctx, $refProps);
 }
 
 sub CreateObject {
@@ -90,6 +90,13 @@
     return $instance;
 }
 
+sub _clone_context {
+    my $args = { %{shift || {}} };
+    delete $args->{CONFIG};
+    
+    return Template::Context->new($args);
+}
+
 sub save {
     die new IMPL::NotImplementedException("This class doesn't support serialization");
 }