annotate Lib/IMPL/Web/View/TTContext.pm @ 343:9bdccdf1f50b

Added a templates context
author cin
date Fri, 13 Sep 2013 12:53:15 +0400
parents
children 72799d1211c5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
343
9bdccdf1f50b Added a templates context
cin
parents:
diff changeset
1 package IMPL::Web::View::TTContext;
9bdccdf1f50b Added a templates context
cin
parents:
diff changeset
2 use strict;
9bdccdf1f50b Added a templates context
cin
parents:
diff changeset
3 use Template::Base;
9bdccdf1f50b Added a templates context
cin
parents:
diff changeset
4
9bdccdf1f50b Added a templates context
cin
parents:
diff changeset
5 use IMPL::declare {
9bdccdf1f50b Added a templates context
cin
parents:
diff changeset
6 base => {
9bdccdf1f50b Added a templates context
cin
parents:
diff changeset
7 'Template::Context' => '@_'
9bdccdf1f50b Added a templates context
cin
parents:
diff changeset
8 }
9bdccdf1f50b Added a templates context
cin
parents:
diff changeset
9 };
9bdccdf1f50b Added a templates context
cin
parents:
diff changeset
10
9bdccdf1f50b Added a templates context
cin
parents:
diff changeset
11 sub clone {
9bdccdf1f50b Added a templates context
cin
parents:
diff changeset
12 my $this = shift;
9bdccdf1f50b Added a templates context
cin
parents:
diff changeset
13
9bdccdf1f50b Added a templates context
cin
parents:
diff changeset
14 $this->localise();
9bdccdf1f50b Added a templates context
cin
parents:
diff changeset
15
9bdccdf1f50b Added a templates context
cin
parents:
diff changeset
16 my $args = { %{$this} };
9bdccdf1f50b Added a templates context
cin
parents:
diff changeset
17
9bdccdf1f50b Added a templates context
cin
parents:
diff changeset
18 $this->delocalise();
9bdccdf1f50b Added a templates context
cin
parents:
diff changeset
19
9bdccdf1f50b Added a templates context
cin
parents:
diff changeset
20 my $class = typeof($this);
9bdccdf1f50b Added a templates context
cin
parents:
diff changeset
21
9bdccdf1f50b Added a templates context
cin
parents:
diff changeset
22 delete $args->{CONFIG};
9bdccdf1f50b Added a templates context
cin
parents:
diff changeset
23
9bdccdf1f50b Added a templates context
cin
parents:
diff changeset
24 return $class->new($args);
9bdccdf1f50b Added a templates context
cin
parents:
diff changeset
25 }
9bdccdf1f50b Added a templates context
cin
parents:
diff changeset
26
9bdccdf1f50b Added a templates context
cin
parents:
diff changeset
27 1;