diff _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 diff
--- a/_test/temp.pl	Fri Oct 04 17:06:34 2013 +0400
+++ b/_test/temp.pl	Mon Oct 07 17:35:54 2013 +0400
@@ -12,31 +12,49 @@
 });
 
 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'
-					     }
-					]
-				}
-			}
-	   }
+	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 => 'site',
+	base => 'layout',
 	includes => [
 	   'packages'
 	],
-	tt_ext => 'tt'
+	tt_ext => 'tt',
+	document => {
+		title => 'Test document'
+	}
 });