Skip to content

Commit

Permalink
document alternatives to render_* methods
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jun 15, 2012
1 parent 6c2fbd2 commit 9b6ae58
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Changes
@@ -1,5 +1,5 @@

3.0 2012-06-14
3.0 2012-06-15
- Code name "Rainbow", this is a major release.
- Switched from HMAC-MD5 to HMAC-SHA1 for signed cookies.
- Added support for new HTTP status code.
Expand Down
12 changes: 12 additions & 0 deletions lib/Mojolicious/Controller.pm
Expand Up @@ -727,6 +727,9 @@ C<extends> features.
Render the given content as raw bytes, similar to C<render_text> but data will
not be encoded.
# Longer version
$c->render(data => $bytes);
=head2 C<render_exception>
$c->render_exception('Oops!');
Expand All @@ -742,6 +745,9 @@ C<exception.$format.*> and set the response status code to C<500>.
Render a data structure as JSON.
# Longer version
$c->render(json => {foo => 'bar'});
=head2 C<render_later>
$c->render_later;
Expand Down Expand Up @@ -770,6 +776,9 @@ C<not_found.$format.*> and set the response status code to C<404>.
Same as C<render> but returns the rendered result.
# Longer version
my $output = $c->render('menubar', partial => 1);
=head2 C<render_static>
my $success = $c->render_static('images/logo.png');
Expand All @@ -788,6 +797,9 @@ See C<render_data> for an alternative without encoding. Note that this does
not change the content type of the response, which is
C<text/html;charset=UTF-8> by default.
# Longer version
$c->render(text => 'Hello World!');
# Render "text/plain" response
$c->render_text('Hello World!', format => 'txt');
Expand Down

0 comments on commit 9b6ae58

Please sign in to comment.