fix for defaults layout

This commit is contained in:
Fayland Lam
2013-04-24 17:09:59 +08:00
committed by Graham Ollis
parent 9be62a9c2c
commit fe963f6511
2 changed files with 42 additions and 1 deletions

View File

@@ -81,12 +81,16 @@ sub _render {
$t = 'inline' if defined $inline;
return unless $t;
my $helper = Mojolicious::Plugin::TtRenderer::Helper->new(ctx => $c);
# Purge previous result
$$output = '';
# fixes for t/lite_app_with_default_layouts.t
unless ($c->stash->{layout}) {
$c->stash->{content} ||= $c->stash->{'mojo.content'}->{content};
}
my @params = ({%{$c->stash}, c => $c, h => $helper}, $output, {binmode => ':utf8'});
my $provider = $self->tt->{SERVICE}->{CONTEXT}->{LOAD_TEMPLATES}->[0];
$provider->options($options);