annotate _test/temp.pl @ 352:675cd1829255

working on TTView: added control classes support
author cin
date Thu, 10 Oct 2013 19:51:19 +0400
parents cfd7570c2af2
children feeb3bc4a818
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 {
351
cfd7570c2af2 working on TTView: created TTView class for rendering models
cin
parents: 350
diff changeset
5 TTView => 'IMPL::Web::View::TTView'
274
8d36073411b1 +Added AutoDispose class
cin
parents: 223
diff changeset
6 };
8d36073411b1 +Added AutoDispose class
cin
parents: 223
diff changeset
7
351
cfd7570c2af2 working on TTView: created TTView class for rendering models
cin
parents: 350
diff changeset
8 use Time::HiRes qw(gettimeofday tv_interval);
cfd7570c2af2 working on TTView: created TTView class for rendering models
cin
parents: 350
diff changeset
9
cfd7570c2af2 working on TTView: created TTView class for rendering models
cin
parents: 350
diff changeset
10 my $t = [gettimeofday];
cfd7570c2af2 working on TTView: created TTView class for rendering models
cin
parents: 350
diff changeset
11
cfd7570c2af2 working on TTView: created TTView class for rendering models
cin
parents: 350
diff changeset
12 my $view = TTView->new(
cfd7570c2af2 working on TTView: created TTView class for rendering models
cin
parents: 350
diff changeset
13 options => {
cfd7570c2af2 working on TTView: created TTView class for rendering models
cin
parents: 350
diff changeset
14 INCLUDE_PATH => './Resources/view',
cfd7570c2af2 working on TTView: created TTView class for rendering models
cin
parents: 350
diff changeset
15 INTERPOLATE => 1,
352
675cd1829255 working on TTView: added control classes support
cin
parents: 351
diff changeset
16 RECURSION => 1000,
675cd1829255 working on TTView: added control classes support
cin
parents: 351
diff changeset
17 COMPILE_DIR => '/tmp/ttc'
351
cfd7570c2af2 working on TTView: created TTView class for rendering models
cin
parents: 350
diff changeset
18 },
cfd7570c2af2 working on TTView: created TTView class for rendering models
cin
parents: 350
diff changeset
19 view => 'site',
cfd7570c2af2 working on TTView: created TTView class for rendering models
cin
parents: 350
diff changeset
20 layout => 'layout',
cfd7570c2af2 working on TTView: created TTView class for rendering models
cin
parents: 350
diff changeset
21 includes => [
cfd7570c2af2 working on TTView: created TTView class for rendering models
cin
parents: 350
diff changeset
22 'packages'
cfd7570c2af2 working on TTView: created TTView class for rendering models
cin
parents: 350
diff changeset
23 ]
cfd7570c2af2 working on TTView: created TTView class for rendering models
cin
parents: 350
diff changeset
24 );
210
6adaeb86945d added IMPL::Web::AutoLocator
sergey
parents: 209
diff changeset
25
352
675cd1829255 working on TTView: added control classes support
cin
parents: 351
diff changeset
26 my $model = {
675cd1829255 working on TTView: added control classes support
cin
parents: 351
diff changeset
27 name => 'debugger',
675cd1829255 working on TTView: added control classes support
cin
parents: 351
diff changeset
28 manufacture => {
675cd1829255 working on TTView: added control classes support
cin
parents: 351
diff changeset
29 name => 'DEBUGGERS INC',
675cd1829255 working on TTView: added control classes support
cin
parents: 351
diff changeset
30 address => [
675cd1829255 working on TTView: added control classes support
cin
parents: 351
diff changeset
31 {
675cd1829255 working on TTView: added control classes support
cin
parents: 351
diff changeset
32 coutry => 'Russuia',
675cd1829255 working on TTView: added control classes support
cin
parents: 351
diff changeset
33 city => 'Moscow'
675cd1829255 working on TTView: added control classes support
cin
parents: 351
diff changeset
34 },
675cd1829255 working on TTView: added control classes support
cin
parents: 351
diff changeset
35 {
675cd1829255 working on TTView: added control classes support
cin
parents: 351
diff changeset
36 country => 'GB',
675cd1829255 working on TTView: added control classes support
cin
parents: 351
diff changeset
37 city => 'Essex'
675cd1829255 working on TTView: added control classes support
cin
parents: 351
diff changeset
38 }
675cd1829255 working on TTView: added control classes support
cin
parents: 351
diff changeset
39 ]
675cd1829255 working on TTView: added control classes support
cin
parents: 351
diff changeset
40 }
675cd1829255 working on TTView: added control classes support
cin
parents: 351
diff changeset
41 };
675cd1829255 working on TTView: added control classes support
cin
parents: 351
diff changeset
42
351
cfd7570c2af2 working on TTView: created TTView class for rendering models
cin
parents: 350
diff changeset
43 print $view->display(
352
675cd1829255 working on TTView: added control classes support
cin
parents: 351
diff changeset
44 $model,
351
cfd7570c2af2 working on TTView: created TTView class for rendering models
cin
parents: 350
diff changeset
45 'product/view',
cfd7570c2af2 working on TTView: created TTView class for rendering models
cin
parents: 350
diff changeset
46 { layout => 'default' }
cfd7570c2af2 working on TTView: created TTView class for rendering models
cin
parents: 350
diff changeset
47 ), "\n";
cfd7570c2af2 working on TTView: created TTView class for rendering models
cin
parents: 350
diff changeset
48
352
675cd1829255 working on TTView: added control classes support
cin
parents: 351
diff changeset
49 print "render page: ",tv_interval($t,[gettimeofday]),"s\n";
675cd1829255 working on TTView: added control classes support
cin
parents: 351
diff changeset
50
675cd1829255 working on TTView: added control classes support
cin
parents: 351
diff changeset
51 $t = [gettimeofday];
675cd1829255 working on TTView: added control classes support
cin
parents: 351
diff changeset
52
675cd1829255 working on TTView: added control classes support
cin
parents: 351
diff changeset
53 $view->display(
675cd1829255 working on TTView: added control classes support
cin
parents: 351
diff changeset
54 $model,
675cd1829255 working on TTView: added control classes support
cin
parents: 351
diff changeset
55 'product/view',
675cd1829255 working on TTView: added control classes support
cin
parents: 351
diff changeset
56 { layout => 'default' }
675cd1829255 working on TTView: added control classes support
cin
parents: 351
diff changeset
57 );
675cd1829255 working on TTView: added control classes support
cin
parents: 351
diff changeset
58
675cd1829255 working on TTView: added control classes support
cin
parents: 351
diff changeset
59 print "2nd render page: ",tv_interval($t,[gettimeofday]),"s\n";
675cd1829255 working on TTView: added control classes support
cin
parents: 351
diff changeset
60