diff Lib/IMPL/Web/View/TTView.pm @ 354:9330835535b9

fixed view double rendering
author cin
date Wed, 16 Oct 2013 17:28:40 +0400
parents feeb3bc4a818
children 833e663796c4
line wrap: on
line diff
--- a/Lib/IMPL/Web/View/TTView.pm	Fri Oct 11 15:49:04 2013 +0400
+++ b/Lib/IMPL/Web/View/TTView.pm	Wed Oct 16 17:28:40 2013 +0400
@@ -41,26 +41,33 @@
 			if ($layout) {
 				return $ctx->invoke_environment(
 					sub {
-						return $ctx->render($layout,$args);
+						return shift->render(
+							$layout,
+							hashMerge(
+								$args,
+								{
+									content => sub {
+										$ctx->invoke_environment(
+											sub {
+												return shift->display_model($model,$template,$args);
+											},
+											{
+												base => $this->viewBase
+											}
+										)
+									}
+								}
+							)
+						); # render
 					},
 					{
 						base => $this->layoutBase,
-						content => sub {
-							$ctx->invoke_environment(
-								sub {
-									return shift->display_model($model,$template,$args);
-								},
-								{
-									base => $this->viewBase
-								}
-							)
-						}
 					}
 				);
 			} else {
 				return $ctx->invoke_environment(
 					sub {
-						return $ctx->display_model($model,$template,$args);
+						return shift->display_model($model,$template,$args);
 					},
 					{
 						base => $this->viewBase