view _test/temp.pl @ 351:cfd7570c2af2

working on TTView: created TTView class for rendering models
author cin
date Tue, 08 Oct 2013 17:40:35 +0400
parents f356c4894d1b
children 675cd1829255
line wrap: on
line source

#!/usr/bin/perl
use strict;

use IMPL::require {
	TTView => 'IMPL::Web::View::TTView'
};

use Time::HiRes qw(gettimeofday tv_interval);

my $t = [gettimeofday];

my $view = TTView->new(
	options => {
		INCLUDE_PATH => './Resources/view',
		INTERPOLATE => 1,
		RECURSION => 1000
	},
	view => 'site',
	layout => 'layout',
	includes => [
		'packages'
	]
);

print $view->display(
	{
		name => 'debugger',
		manufacture => {
			name => 'DEBUGGERS INC',
			address => [
				{
					coutry => 'Russuia',
					city => 'Moscow'
				},
				{
					country => 'GB',
					city => 'Essex'
				}
			]
		}
	},
	'product/view',
	{ layout => 'default' }
), "\n";

print "render page: ",tv_interval($t,[gettimeofday]),"ms\n";