annotate _test/temp.pl @ 350:f356c4894d1b

working on TTView: layouts
author cin
date Mon, 07 Oct 2013 17:35:54 +0400
parents 86b470004d47
children cfd7570c2af2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
210
6adaeb86945d added IMPL::Web::AutoLocator
sergey
parents: 209
diff changeset
1 #!/usr/bin/perl
6adaeb86945d added IMPL::Web::AutoLocator
sergey
parents: 209
diff changeset
2 use strict;
6adaeb86945d added IMPL::Web::AutoLocator
sergey
parents: 209
diff changeset
3
274
8d36073411b1 +Added AutoDispose class
cin
parents: 223
diff changeset
4 use IMPL::require {
348
f116cd9fe7d9 working on TTView: pre-alpha version
cin
parents: 274
diff changeset
5 TTContext => 'IMPL::Web::View::TTContext'
274
8d36073411b1 +Added AutoDispose class
cin
parents: 223
diff changeset
6 };
8d36073411b1 +Added AutoDispose class
cin
parents: 223
diff changeset
7
348
f116cd9fe7d9 working on TTView: pre-alpha version
cin
parents: 274
diff changeset
8 my $ctx = TTContext->new({
f116cd9fe7d9 working on TTView: pre-alpha version
cin
parents: 274
diff changeset
9 INCLUDE_PATH => './Resources/view',
f116cd9fe7d9 working on TTView: pre-alpha version
cin
parents: 274
diff changeset
10 INTERPOLATE => 1,
f116cd9fe7d9 working on TTView: pre-alpha version
cin
parents: 274
diff changeset
11 RECURSION => 1000
f116cd9fe7d9 working on TTView: pre-alpha version
cin
parents: 274
diff changeset
12 });
210
6adaeb86945d added IMPL::Web::AutoLocator
sergey
parents: 209
diff changeset
13
348
f116cd9fe7d9 working on TTView: pre-alpha version
cin
parents: 274
diff changeset
14 print $ctx->invoke_environment(sub {
350
f356c4894d1b working on TTView: layouts
cin
parents: 349
diff changeset
15 my ($this) = @_;
f356c4894d1b working on TTView: layouts
cin
parents: 349
diff changeset
16 return $this->render(
f356c4894d1b working on TTView: layouts
cin
parents: 349
diff changeset
17 'default',
f356c4894d1b working on TTView: layouts
cin
parents: 349
diff changeset
18 {
f356c4894d1b working on TTView: layouts
cin
parents: 349
diff changeset
19 content => sub {
f356c4894d1b working on TTView: layouts
cin
parents: 349
diff changeset
20 return $this->invoke_environment(
f356c4894d1b working on TTView: layouts
cin
parents: 349
diff changeset
21 sub {
f356c4894d1b working on TTView: layouts
cin
parents: 349
diff changeset
22 shift->render(
f356c4894d1b working on TTView: layouts
cin
parents: 349
diff changeset
23 'product/view',
f356c4894d1b working on TTView: layouts
cin
parents: 349
diff changeset
24 {
f356c4894d1b working on TTView: layouts
cin
parents: 349
diff changeset
25 model => {
f356c4894d1b working on TTView: layouts
cin
parents: 349
diff changeset
26 name => 'debugger',
f356c4894d1b working on TTView: layouts
cin
parents: 349
diff changeset
27 manufature => {
f356c4894d1b working on TTView: layouts
cin
parents: 349
diff changeset
28 name => 'DEBUGGERS INC',
f356c4894d1b working on TTView: layouts
cin
parents: 349
diff changeset
29 address => [
f356c4894d1b working on TTView: layouts
cin
parents: 349
diff changeset
30 {
f356c4894d1b working on TTView: layouts
cin
parents: 349
diff changeset
31 coutry => 'Russuia',
f356c4894d1b working on TTView: layouts
cin
parents: 349
diff changeset
32 city => 'Moscow'
f356c4894d1b working on TTView: layouts
cin
parents: 349
diff changeset
33 },
f356c4894d1b working on TTView: layouts
cin
parents: 349
diff changeset
34 {
f356c4894d1b working on TTView: layouts
cin
parents: 349
diff changeset
35 country => 'GB',
f356c4894d1b working on TTView: layouts
cin
parents: 349
diff changeset
36 city => 'Essex'
f356c4894d1b working on TTView: layouts
cin
parents: 349
diff changeset
37 }
f356c4894d1b working on TTView: layouts
cin
parents: 349
diff changeset
38 ]
f356c4894d1b working on TTView: layouts
cin
parents: 349
diff changeset
39 }
f356c4894d1b working on TTView: layouts
cin
parents: 349
diff changeset
40 }
f356c4894d1b working on TTView: layouts
cin
parents: 349
diff changeset
41 }
f356c4894d1b working on TTView: layouts
cin
parents: 349
diff changeset
42 );
f356c4894d1b working on TTView: layouts
cin
parents: 349
diff changeset
43 }, {
f356c4894d1b working on TTView: layouts
cin
parents: 349
diff changeset
44 base => 'site'
f356c4894d1b working on TTView: layouts
cin
parents: 349
diff changeset
45 }
f356c4894d1b working on TTView: layouts
cin
parents: 349
diff changeset
46 );
f356c4894d1b working on TTView: layouts
cin
parents: 349
diff changeset
47 }
f356c4894d1b working on TTView: layouts
cin
parents: 349
diff changeset
48 }
348
f116cd9fe7d9 working on TTView: pre-alpha version
cin
parents: 274
diff changeset
49 );
f116cd9fe7d9 working on TTView: pre-alpha version
cin
parents: 274
diff changeset
50 }, {
350
f356c4894d1b working on TTView: layouts
cin
parents: 349
diff changeset
51 base => 'layout',
348
f116cd9fe7d9 working on TTView: pre-alpha version
cin
parents: 274
diff changeset
52 includes => [
f116cd9fe7d9 working on TTView: pre-alpha version
cin
parents: 274
diff changeset
53 'packages'
f116cd9fe7d9 working on TTView: pre-alpha version
cin
parents: 274
diff changeset
54 ],
350
f356c4894d1b working on TTView: layouts
cin
parents: 349
diff changeset
55 tt_ext => 'tt',
f356c4894d1b working on TTView: layouts
cin
parents: 349
diff changeset
56 document => {
f356c4894d1b working on TTView: layouts
cin
parents: 349
diff changeset
57 title => 'Test document'
f356c4894d1b working on TTView: layouts
cin
parents: 349
diff changeset
58 }
348
f116cd9fe7d9 working on TTView: pre-alpha version
cin
parents: 274
diff changeset
59 });
215
77a9934a44af sync, migrating to XML::Compile
cin
parents: 210
diff changeset
60