diff _test/temp.pl @ 348:f116cd9fe7d9

working on TTView: pre-alpha version
author cin
date Thu, 03 Oct 2013 19:48:57 +0400
parents 8d36073411b1
children 86b470004d47
line wrap: on
line diff
--- a/_test/temp.pl	Mon Sep 30 17:36:17 2013 +0400
+++ b/_test/temp.pl	Thu Oct 03 19:48:57 2013 +0400
@@ -1,42 +1,44 @@
 #!/usr/bin/perl
 use strict;
 
-{
-    package Foo;
-    use IMPL::declare {
-        base => [
-            'IMPL::Object::Disposable' => undef
-        ]
-    };
-}
-
-use Time::HiRes qw(gettimeofday tv_interval);
-
-
-use IMPL::lang;
 use IMPL::require {
-    AutoDispose => 'IMPL::Object::AutoDispose',
-    DBSchema => 'IMPL::SQL::Schema'    
+	TTContext => 'IMPL::Web::View::TTContext'
 };
 
-my $real = DBSchema->new( name => 'simple', version => 1);
-my $proxy = AutoDispose->new($real);
-
-print typeof($proxy),"\n";
+my $ctx = TTContext->new({
+	INCLUDE_PATH => './Resources/view',
+	INTERPOLATE => 1,
+	RECURSION => 1000
+});
 
-my $t = [gettimeofday];
-
-for (1..1000000) {
-    $proxy->name;
-}
+warn $ctx->load_templates->[0]->include_path->[0];
 
-print "proxy: ",tv_interval($t,[gettimeofday]),"\n";
-
-$t = [gettimeofday];
-
-for (1..1000000) {
-    $real->name;
-}
-
-print "real:  ",tv_interval($t,[gettimeofday]),"\n";
+print $ctx->invoke_environment(sub {
+	return shift->render(
+	    'product/view',{
+			model => {
+				name => 'debugger',
+				manufature => {
+					name => 'DEBUGGERS INC',
+					address => [
+					     {
+					     	coutry => 'Russuia',
+					     	city => 'Moscow'
+					     },
+					     {
+					     	country => 'GB',
+					     	city => 'Essex'
+					     }
+					]
+				}
+			}
+	   }
+    );
+}, {
+	base => 'site',
+	includes => [
+	   'packages'
+	],
+	tt_ext => 'tt'
+});