view _test/temp.pl @ 350:f356c4894d1b

working on TTView: layouts
author cin
date Mon, 07 Oct 2013 17:35:54 +0400
parents 86b470004d47
children cfd7570c2af2
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
});

print $ctx->invoke_environment(sub {
	my ($this) = @_;
	return $this->render(
	    'default',
	    {
	    	content => sub {
	    		return $this->invoke_environment(
	    		    sub {
		    			shift->render(
			                'product/view',
			                {
					            model => {
								    name => 'debugger',
								    manufature => {
										name => 'DEBUGGERS INC',
										address => [
										     {
										     	coutry => 'Russuia',
										     	city => 'Moscow'
										     },
										     {
										     	country => 'GB',
										     	city => 'Essex'
										     }
										]
								    }
					            }				            
						    }
						);
		    		}, {
		    			base => 'site'
		    		}
                );
		    }
	    }
    );
}, {
	base => 'layout',
	includes => [
	   'packages'
	],
	tt_ext => 'tt',
	document => {
		title => 'Test document'
	}
});