Mercurial > pub > Impl
comparison Lib/IMPL/Web/View/TTLoader.pm @ 289:85572f512abc
*TTView refactoring
| author | cin |
|---|---|
| date | Wed, 20 Feb 2013 02:25:30 +0400 |
| parents | 2d253e6e4a88 |
| children | 47a09a8dc23a |
comparison
equal
deleted
inserted
replaced
| 288:3a9cfea098dd | 289:85572f512abc |
|---|---|
| 76 $this->_init(); | 76 $this->_init(); |
| 77 | 77 |
| 78 my $opts = { %{ $this->options } }; | 78 my $opts = { %{ $this->options } }; |
| 79 | 79 |
| 80 $this->context->localise(); | 80 $this->context->localise(); |
| 81 my $ctx = Template::Context->new( %{$this->context} ); | 81 my $ctx = _clone_context($this->context); |
| 82 $this->context->delocalise(); | 82 $this->context->delocalise(); |
| 83 | 83 |
| 84 return TTDocument->new( $tt, $ctx, $this, $vars ); | 84 return TTDocument->new( $tt, $ctx, $this, $vars ); |
| 85 } | 85 } |
| 86 | 86 |
| 142 die Exception->new("Failed to process an initializer", $this->initializer, $e); | 142 die Exception->new("Failed to process an initializer", $this->initializer, $e); |
| 143 } | 143 } |
| 144 | 144 |
| 145 $this->isInitialized(1); | 145 $this->isInitialized(1); |
| 146 } | 146 } |
| 147 } | |
| 148 | |
| 149 sub _clone_context { | |
| 150 my $args = { %{shift || {}} }; | |
| 151 delete $args->{CONFIG}; | |
| 152 | |
| 153 return Template::Context->new($args); | |
| 147 } | 154 } |
| 148 | 155 |
| 149 1; | 156 1; |
| 150 | 157 |
| 151 __END__ | 158 __END__ |
