Mercurial > pub > Impl
comparison Lib/IMPL/Web/View/TTDocument.pm @ 309:5e4e7c8fbca1
sync
author | cin |
---|---|
date | Fri, 19 Apr 2013 00:27:51 +0400 |
parents | 47a09a8dc23a |
children | 0a9d51cf6dfd |
comparison
equal
deleted
inserted
replaced
308:47a09a8dc23a | 309:5e4e7c8fbca1 |
---|---|
4 use Scalar::Util qw(weaken); | 4 use Scalar::Util qw(weaken); |
5 use IMPL::Const qw(:prop); | 5 use IMPL::Const qw(:prop); |
6 use IMPL::lang qw(:hash is); | 6 use IMPL::lang qw(:hash is); |
7 use Carp qw(carp); | 7 use Carp qw(carp); |
8 use mro; | 8 use mro; |
9 | 9 use IMPL::Exception(); |
10 use IMPL::declare { | 10 use IMPL::declare { |
11 require => { | 11 require => { |
12 TTRegistry => 'IMPL::Web::View::TTRegistry', | 12 TTRegistry => 'IMPL::Web::View::TTRegistry', |
13 TTFactory => 'IMPL::Web::View::TTFactory', | 13 TTFactory => 'IMPL::Web::View::TTFactory', |
14 TTControl => 'IMPL::Web::View::TTControl', | 14 TTControl => 'IMPL::Web::View::TTControl', |
15 Loader => 'IMPL::Code::Loader' | 15 Loader => 'IMPL::Code::Loader', |
16 OpException => '-IMPL::InvalidOperationException' | |
16 }, | 17 }, |
17 base => [ | 18 base => [ |
18 'IMPL::Web::View::TTControl' => sub { | 19 'IMPL::Web::View::TTControl' => sub { |
19 my ($template,$ctx) = @_; | 20 my ($template,$ctx,$vars) = @_; |
20 $ctx ||= Template::Context->new(); | 21 $ctx ||= Template::Context->new(); |
21 return $template, $ctx; # context | 22 return $template, $ctx, $vars; # context |
22 } | 23 } |
23 ], | 24 ], |
24 props => [ | 25 props => [ |
25 layout => PROP_RW, | 26 layout => PROP_RW, |
26 baseLocation => PROP_RW | 27 baseLocation => PROP_RW |
50 }); | 51 }); |
51 | 52 |
52 my $text = eval { | 53 my $text = eval { |
53 | 54 |
54 if ($this->layout) { | 55 if ($this->layout) { |
55 my $tlayout = $this->GetTemplate($this->layout); | 56 my $tlayout = $this->registry->loader->layout($this->layout) |
57 or die OpException->new('The specified layout isn\'t found', $this->layout); | |
56 if(my $init = $tlayout->blocks->{INIT}) { | 58 if(my $init = $tlayout->blocks->{INIT}) { |
57 $this->context->process( | 59 $this->context->process( |
58 $init, | 60 $init, |
59 hashMerge( | 61 hashMerge( |
60 $args, | 62 $args, |