Mercurial > pub > Impl
diff Lib/IMPL/Web/View/TTFactory.pm @ 287:2d253e6e4a88
*TTView refactoring
author | cin |
---|---|
date | Tue, 19 Feb 2013 03:05:10 +0400 |
parents | c6d0f889ef87 |
children | 3a9cfea098dd |
line wrap: on
line diff
--- a/Lib/IMPL/Web/View/TTFactory.pm Mon Feb 18 14:46:06 2013 +0400 +++ b/Lib/IMPL/Web/View/TTFactory.pm Tue Feb 19 03:05:10 2013 +0400 @@ -16,23 +16,20 @@ props => [ template => PROP_RW, context => PROP_RW, - opts => PROP_RW, instances => PROP_RW, base => PROP_RW ] }; sub CTOR { - my ($this,$factory,$template,$context,$options,$base) = @_; + my ($this,$factory,$template,$context,$base) = @_; die IMPL::ArgumentException("A template is required") unless $template; - $options ||= {}; - $context ||= new Template::Context($options); + $context ||= new Template::Context(); $this->template($template); $this->context($context); - $this->opts($options); $this->base($base); $this->instances(0); } @@ -46,12 +43,13 @@ sub MergeParameters { my ($this,$name,$refProps) = @_; - my $opts = { %{ $this->opts } }; - $opts->{STASH} = $opts->{STASH}->clone() if $opts->{STASH}; - my $base = $this->base; - my $ctx = new Template::Context($opts); + $this->context->localise(); + + my $ctx = new Template::Context({ %{$this->context} }); + + $this->context->delocalise(); my $stash = $ctx->stash; weaken($stash);