Permalink
Browse files

more render examples

  • Loading branch information...
1 parent f761bcc commit 8240fa3a7eac50fe79922dcfcad757e14b1376aa @kraih committed Apr 11, 2012
Showing with 6 additions and 3 deletions.
  1. +5 −3 lib/Mojolicious/Controller.pm
  2. +1 −0 lib/Mojolicious/Guides/Rendering.pod
@@ -740,12 +740,14 @@ C<url_for>.
my $success = $c->render;
my $success = $c->render(controller => 'foo', action => 'bar');
my $success = $c->render({controller => 'foo', action => 'bar'});
- my $success = $c->render(text => 'Hello!');
my $success = $c->render(template => 'foo/index');
my $success = $c->render(template => 'index', format => 'html');
+ my $success = $c->render(data => $bytes);
+ my $success = $c->render(text => 'Hello!');
+ my $success = $c->render(json => {foo => 'bar'});
my $success = $c->render(handler => 'something');
- my $success = $c->render('foo/bar');
- my $output = $c->render('foo/bar', partial => 1);
+ my $success = $c->render('foo/index');
+ my $output = $c->render('foo/index', partial => 1);
This is a wrapper around L<Mojolicious::Renderer/"render"> exposing pretty
much all functionality provided by it. It will set a default template to use
@@ -1,3 +1,4 @@
+
=encoding utf8
=head1 NAME

0 comments on commit 8240fa3

Please sign in to comment.