diff Lib/IMPL/Web/View/TTDocument.pm @ 309:5e4e7c8fbca1

sync
author cin
date Fri, 19 Apr 2013 00:27:51 +0400
parents 47a09a8dc23a
children 0a9d51cf6dfd
line wrap: on
line diff
--- a/Lib/IMPL/Web/View/TTDocument.pm	Thu Apr 18 20:06:05 2013 +0400
+++ b/Lib/IMPL/Web/View/TTDocument.pm	Fri Apr 19 00:27:51 2013 +0400
@@ -6,19 +6,20 @@
 use IMPL::lang qw(:hash is);
 use Carp qw(carp);
 use mro;
-
+use IMPL::Exception();
 use IMPL::declare {
     require => {
     	TTRegistry => 'IMPL::Web::View::TTRegistry',
         TTFactory => 'IMPL::Web::View::TTFactory',
         TTControl =>  'IMPL::Web::View::TTControl',
-        Loader => 'IMPL::Code::Loader'
+        Loader => 'IMPL::Code::Loader',
+        OpException => '-IMPL::InvalidOperationException'
     },
     base => [
         'IMPL::Web::View::TTControl' => sub {
-            my ($template,$ctx) = @_;
+            my ($template,$ctx,$vars) = @_;
             $ctx ||= Template::Context->new();
-            return $template, $ctx;  # context
+            return $template, $ctx, $vars;  # context
         }
     ],
     props => [
@@ -52,7 +53,8 @@
     my $text = eval {
     
         if ($this->layout) {
-        	my $tlayout = $this->GetTemplate($this->layout);
+        	my $tlayout = $this->registry->loader->layout($this->layout)
+        	   or die OpException->new('The specified layout isn\'t found', $this->layout);
         	if(my $init = $tlayout->blocks->{INIT}) {
         		$this->context->process(
                     $init,