view _test/temp.pl @ 367:608e74bc309f

form metadata, mostly done
author cin
date Tue, 03 Dec 2013 17:55:36 +0400
parents feeb3bc4a818
children d5c8b955bf8d
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,
		COMPILE_DIR => '/tmp/ttc'
	},
	viewBase => 'site',
	layoutBase => 'layout',
	layout => 'default',
	includes => [
		'packages'
	]
);

my $model = {
	name => 'debugger',
	manufacture => {
		name => 'DEBUGGERS INC',
		address => [
			{
				coutry => 'Russuia',
				city => 'Moscow'
			},
			{
				country => 'GB',
				city => 'Essex'
			}
		]
	}
}; 

print $view->display(
	$model,
	'product/view'
), "\n";

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

$t = [gettimeofday];

$view->display(
	$model,
	'product/view'
);

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