diff Lib/IMPL/Web/View/TTFactory.pm @ 288:3a9cfea098dd

*TTView refactoring: removed RequireControl method, etc.
author sergey
date Tue, 19 Feb 2013 19:58:27 +0400
parents 2d253e6e4a88
children 85572f512abc
line wrap: on
line diff
--- a/Lib/IMPL/Web/View/TTFactory.pm	Tue Feb 19 03:05:10 2013 +0400
+++ b/Lib/IMPL/Web/View/TTFactory.pm	Tue Feb 19 19:58:27 2013 +0400
@@ -17,12 +17,13 @@
         template => PROP_RW,
         context => PROP_RW,
         instances => PROP_RW,
-        base => PROP_RW 
+        base => PROP_RW,
+        require => PROP_RO
     ]
 };
 
 sub CTOR {
-    my ($this,$factory,$template,$context,$base) = @_;
+    my ($this,$factory,$template,$context,$base,$require) = @_;
     
     die IMPL::ArgumentException("A template is required") unless $template;
     
@@ -32,6 +33,7 @@
     $this->context($context);
     $this->base($base);
     $this->instances(0);
+    $this->require($require);
 }
 
 our %CTOR = (
@@ -52,14 +54,14 @@
     $this->context->delocalise();
     
     my $stash = $ctx->stash;
-    weaken($stash);
-    
+    my $require = $this->require;
+
     $stash->update({
         require => sub {
             my ($module) = @_;
             
             $module =~ s/^\.\//$base\//;
-            return $stash->get('document')->RequireControl($module);
+            return $require->($module);
         }        
     });