comparison Lib/IMPL/Web/View/TTDocument.pm @ 291:5d14baa35790

*TTView: fixed template selectors mechanism
author cin
date Thu, 21 Feb 2013 03:44:02 +0400
parents 7b0dad6117d5
children 78f767765706
comparison
equal deleted inserted replaced
290:7b0dad6117d5 291:5d14baa35790
52 my $self = $this; 52 my $self = $this;
53 53
54 $require = sub { 54 $require = sub {
55 my $control = shift; 55 my $control = shift;
56 56
57 carp("Cant load control $control outside the rendering procedure") unless $self; 57 unless($self) {
58 carp("Cant load control $control outside the rendering procedure");
59 return;
60 }
58 61
59 if (my $factory = $controls{$control}) { 62 if (my $factory = $controls{$control}) {
60 return $factory; 63 return $factory;
61 } else { 64 } else {
62 my $path = $control; 65 my $path = $control;
87 90
88 $this->context->localise(); 91 $this->context->localise();
89 $documentContext = _clone_context( $this->context ); 92 $documentContext = _clone_context( $this->context );
90 93
91 $this->context->stash->set(require => $require); 94 $this->context->stash->set(require => $require);
92 $this->context->stash->set(document => sub { $self }); 95 $this->context->stash->set(document => sub { $self });
93
94 96
95 my $text = eval { 97 my $text = eval {
96 98
97 if ($this->layout) { 99 if ($this->layout) {
98 my $tlayout = $this->loader->layout($this->layout); 100 my $tlayout = $this->loader->layout($this->layout);