comparison 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
comparison
equal deleted inserted replaced
353:feeb3bc4a818 354:9330835535b9
39 sub { 39 sub {
40 my $ctx = shift; 40 my $ctx = shift;
41 if ($layout) { 41 if ($layout) {
42 return $ctx->invoke_environment( 42 return $ctx->invoke_environment(
43 sub { 43 sub {
44 return $ctx->render($layout,$args); 44 return shift->render(
45 $layout,
46 hashMerge(
47 $args,
48 {
49 content => sub {
50 $ctx->invoke_environment(
51 sub {
52 return shift->display_model($model,$template,$args);
53 },
54 {
55 base => $this->viewBase
56 }
57 )
58 }
59 }
60 )
61 ); # render
45 }, 62 },
46 { 63 {
47 base => $this->layoutBase, 64 base => $this->layoutBase,
48 content => sub {
49 $ctx->invoke_environment(
50 sub {
51 return shift->display_model($model,$template,$args);
52 },
53 {
54 base => $this->viewBase
55 }
56 )
57 }
58 } 65 }
59 ); 66 );
60 } else { 67 } else {
61 return $ctx->invoke_environment( 68 return $ctx->invoke_environment(
62 sub { 69 sub {
63 return $ctx->display_model($model,$template,$args); 70 return shift->display_model($model,$template,$args);
64 }, 71 },
65 { 72 {
66 base => $this->viewBase 73 base => $this->viewBase
67 } 74 }
68 ); 75 );