Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix extends

  • Loading branch information...
commit dd1e13f93cc403103f6bf0f31a10545a22f04651 1 parent ebfd0b4
@yko authored
Showing with 7 additions and 3 deletions.
  1. +3 −0  lib/MojoX/Renderer.pm
  2. +4 −3 t/mojolicious/lite_app.t
View
3  lib/MojoX/Renderer.pm
@@ -185,6 +185,9 @@ sub render {
# Render
$self->_render_template($c, \$output, $options);
+
+ # Extends
+ $content->{content} = b("$output");
}
# Encoding (JSON is already encoded)
View
7 t/mojolicious/lite_app.t
@@ -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)
@@ -1310,6 +1310,7 @@ Default header!
%{= content sidebar =>
<%= stash 'foo' %> sidebar!
%}
+Layout content
%= content
%{= content footer =>
Default footer!
Please sign in to comment.
Something went wrong with that request. Please try again.