Skip to content

Commit

Permalink
fix extends
Browse files Browse the repository at this point in the history
  • Loading branch information
yko committed Aug 29, 2010
1 parent ebfd0b4 commit dd1e13f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions lib/MojoX/Renderer.pm
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ sub render {

# Render
$self->_render_template($c, \$output, $options);

# Extends
$content->{content} = b("$output");
}

# Encoding (JSON is already encoded)
Expand Down
7 changes: 4 additions & 3 deletions t/mojolicious/lite_app.t
Original file line number Diff line number Diff line change
Expand Up @@ -792,19 +792,19 @@ $t->get_ok('/template_inheritance')->status_is(200)
->header_is(Server => 'Mojolicious (Perl)')
->header_is('X-Powered-By' => 'Mojolicious (Perl)')
->content_is(
"<title>Welcome</title>\nSidebar!\nHello World!\nDefault footer!\n");
"<title>Welcome</title>\nSidebar!\nLayout content\nHello World!\nDefault footer!\n");

# GET /layout_without_inheritance
$t->get_ok('/layout_without_inheritance')->status_is(200)
->header_is(Server => 'Mojolicious (Perl)')
->header_is('X-Powered-By' => 'Mojolicious (Perl)')
->content_is("Default header!\nDefault sidebar!\nDefault footer!\n");
->content_is("Default header!\nDefault sidebar!\nLayout content\nDefault footer!\n");

# GET /double_inheritance
$t->get_ok('/double_inheritance')->status_is(200)
->header_is(Server => 'Mojolicious (Perl)')
->header_is('X-Powered-By' => 'Mojolicious (Perl)')
->content_is("<title>Welcome</title>\nSidebar too!\nDefault footer!\n");
->content_is("<title>Welcome</title>\nSidebar too!\nLayout content\nHello World!\nDefault footer!\n");

# GET /nested-includes
$t->get_ok('/nested-includes')->status_is(200)
Expand Down Expand Up @@ -1310,6 +1310,7 @@ Default header!
%{= content sidebar =>
<%= stash 'foo' %> sidebar!
%}
Layout content
%= content
%{= content footer =>
Default footer!
Expand Down

0 comments on commit dd1e13f

Please sign in to comment.