Mercurial > pub > Impl
comparison _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 |
comparison
equal
deleted
inserted
replaced
351:cfd7570c2af2 | 352:675cd1829255 |
---|---|
11 | 11 |
12 my $view = TTView->new( | 12 my $view = TTView->new( |
13 options => { | 13 options => { |
14 INCLUDE_PATH => './Resources/view', | 14 INCLUDE_PATH => './Resources/view', |
15 INTERPOLATE => 1, | 15 INTERPOLATE => 1, |
16 RECURSION => 1000 | 16 RECURSION => 1000, |
17 COMPILE_DIR => '/tmp/ttc' | |
17 }, | 18 }, |
18 view => 'site', | 19 view => 'site', |
19 layout => 'layout', | 20 layout => 'layout', |
20 includes => [ | 21 includes => [ |
21 'packages' | 22 'packages' |
22 ] | 23 ] |
23 ); | 24 ); |
24 | 25 |
26 my $model = { | |
27 name => 'debugger', | |
28 manufacture => { | |
29 name => 'DEBUGGERS INC', | |
30 address => [ | |
31 { | |
32 coutry => 'Russuia', | |
33 city => 'Moscow' | |
34 }, | |
35 { | |
36 country => 'GB', | |
37 city => 'Essex' | |
38 } | |
39 ] | |
40 } | |
41 }; | |
42 | |
25 print $view->display( | 43 print $view->display( |
26 { | 44 $model, |
27 name => 'debugger', | |
28 manufacture => { | |
29 name => 'DEBUGGERS INC', | |
30 address => [ | |
31 { | |
32 coutry => 'Russuia', | |
33 city => 'Moscow' | |
34 }, | |
35 { | |
36 country => 'GB', | |
37 city => 'Essex' | |
38 } | |
39 ] | |
40 } | |
41 }, | |
42 'product/view', | 45 'product/view', |
43 { layout => 'default' } | 46 { layout => 'default' } |
44 ), "\n"; | 47 ), "\n"; |
45 | 48 |
46 print "render page: ",tv_interval($t,[gettimeofday]),"ms\n"; | 49 print "render page: ",tv_interval($t,[gettimeofday]),"s\n"; |
47 | 50 |
51 $t = [gettimeofday]; | |
52 | |
53 $view->display( | |
54 $model, | |
55 'product/view', | |
56 { layout => 'default' } | |
57 ); | |
58 | |
59 print "2nd render page: ",tv_interval($t,[gettimeofday]),"s\n"; | |
60 |