view _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 source

#!/usr/bin/perl
use strict;

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

my $ctx = TTContext->new({
	INCLUDE_PATH => './Resources/view',
	INTERPOLATE => 1,
	RECURSION => 1000
});

warn $ctx->load_templates->[0]->include_path->[0];

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'
});