diff Lib/IMPL/Web/View/TTLoader.pm @ 308:47a09a8dc23a

sync
author sergey
date Thu, 18 Apr 2013 20:06:05 +0400
parents 85572f512abc
children 5e4e7c8fbca1
line wrap: on
line diff
--- a/Lib/IMPL/Web/View/TTLoader.pm	Thu Apr 18 02:21:28 2013 +0400
+++ b/Lib/IMPL/Web/View/TTLoader.pm	Thu Apr 18 20:06:05 2013 +0400
@@ -8,7 +8,7 @@
     require => {
         Provider => 'Template::Provider',
         Context => 'Template::Context',
-        TTDocument => 'IMPL::Web::View::TTDocument',
+        TTFactory => 'IMPL::Web::View::TTFactory',
         Exception => 'IMPL::Exception',
         ArgumentException => '-IMPL::InvalidArgumentException',
         KeyNotFoundException => '-IMPL::KeyNotFoundException'
@@ -71,6 +71,8 @@
 sub document {
     my ($this,$name,$vars) = @_;
     
+    $vars ||= $vars;
+    
     my $tt = $this->template($name);
         
     $this->_init();
@@ -81,9 +83,12 @@
     my $ctx = _clone_context($this->context);
     $this->context->delocalise();
     
-    return TTDocument->new( $tt, $ctx, $this, $vars );
+    my $factory = TTFactory->new($tt,$ctx,$name,TTRegistry->new($this, $ctx));
+    
+    return $factory->new( $vars );
 }
 
+
 sub template {
     my ($this,$name) = @_;