annotate _test/temp.pl @ 355:8dfb9df07d02

added support for the custom resolvers for the TTView
author sergey
date Thu, 17 Oct 2013 01:04:37 +0400
parents feeb3bc4a818
children d5c8b955bf8d
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 },
353
feeb3bc4a818 corrected error handling while loading templates
cin
parents: 352
diff changeset
19 viewBase => 'site',
feeb3bc4a818 corrected error handling while loading templates
cin
parents: 352
diff changeset
20 layoutBase => 'layout',
feeb3bc4a818 corrected error handling while loading templates
cin
parents: 352
diff changeset
21 layout => 'default',
351
cfd7570c2af2 working on TTView: created TTView class for rendering models
cin
parents: 350
diff changeset
22 includes => [
cfd7570c2af2 working on TTView: created TTView class for rendering models
cin
parents: 350
diff changeset
23 'packages'
cfd7570c2af2 working on TTView: created TTView class for rendering models
cin
parents: 350
diff changeset
24 ]
cfd7570c2af2 working on TTView: created TTView class for rendering models
cin
parents: 350
diff changeset
25 );
210
6adaeb86945d added IMPL::Web::AutoLocator
sergey
parents: 209
diff changeset
26
352
675cd1829255 working on TTView: added control classes support
cin
parents: 351
diff changeset
27 my $model = {
675cd1829255 working on TTView: added control classes support
cin
parents: 351
diff changeset
28 name => 'debugger',
675cd1829255 working on TTView: added control classes support
cin
parents: 351
diff changeset
29 manufacture => {
675cd1829255 working on TTView: added control classes support
cin
parents: 351
diff changeset
30 name => 'DEBUGGERS INC',
675cd1829255 working on TTView: added control classes support
cin
parents: 351
diff changeset
31 address => [
675cd1829255 working on TTView: added control classes support
cin
parents: 351
diff changeset
32 {
675cd1829255 working on TTView: added control classes support
cin
parents: 351
diff changeset
33 coutry => 'Russuia',
675cd1829255 working on TTView: added control classes support
cin
parents: 351
diff changeset
34 city => 'Moscow'
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 {
675cd1829255 working on TTView: added control classes support
cin
parents: 351
diff changeset
37 country => 'GB',
675cd1829255 working on TTView: added control classes support
cin
parents: 351
diff changeset
38 city => 'Essex'
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 };
675cd1829255 working on TTView: added control classes support
cin
parents: 351
diff changeset
43
351
cfd7570c2af2 working on TTView: created TTView class for rendering models
cin
parents: 350
diff changeset
44 print $view->display(
352
675cd1829255 working on TTView: added control classes support
cin
parents: 351
diff changeset
45 $model,
353
feeb3bc4a818 corrected error handling while loading templates
cin
parents: 352
diff changeset
46 'product/view'
351
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,
353
feeb3bc4a818 corrected error handling while loading templates
cin
parents: 352
diff changeset
55 'product/view'
352
675cd1829255 working on TTView: added control classes support
cin
parents: 351
diff changeset
56 );
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 print "2nd render page: ",tv_interval($t,[gettimeofday]),"s\n";
675cd1829255 working on TTView: added control classes support
cin
parents: 351
diff changeset
59