Mercurial > pub > Impl
annotate _test/temp.pl @ 366:935629bf80df
model metadata, in progress
author | cin |
---|---|
date | Mon, 02 Dec 2013 17:44:38 +0400 |
parents | feeb3bc4a818 |
children | d5c8b955bf8d |
rev | line source |
---|---|
210 | 1 #!/usr/bin/perl |
2 use strict; | |
3 | |
274 | 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 | 6 }; |
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 | 16 RECURSION => 1000, |
17 COMPILE_DIR => '/tmp/ttc' | |
351
cfd7570c2af2
working on TTView: created TTView class for rendering models
cin
parents:
350
diff
changeset
|
18 }, |
353 | 19 viewBase => 'site', |
20 layoutBase => 'layout', | |
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 | 26 |
352 | 27 my $model = { |
28 name => 'debugger', | |
29 manufacture => { | |
30 name => 'DEBUGGERS INC', | |
31 address => [ | |
32 { | |
33 coutry => 'Russuia', | |
34 city => 'Moscow' | |
35 }, | |
36 { | |
37 country => 'GB', | |
38 city => 'Essex' | |
39 } | |
40 ] | |
41 } | |
42 }; | |
43 | |
351
cfd7570c2af2
working on TTView: created TTView class for rendering models
cin
parents:
350
diff
changeset
|
44 print $view->display( |
352 | 45 $model, |
353 | 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 | 49 print "render page: ",tv_interval($t,[gettimeofday]),"s\n"; |
50 | |
51 $t = [gettimeofday]; | |
52 | |
53 $view->display( | |
54 $model, | |
353 | 55 'product/view' |
352 | 56 ); |
57 | |
58 print "2nd render page: ",tv_interval($t,[gettimeofday]),"s\n"; | |
59 |