Skip to content

Commit

Permalink
returning undef is a feature
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jun 19, 2014
1 parent d40456b commit 7e6ad47
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Changes
@@ -1,5 +1,5 @@

5.09 2014-06-18
5.09 2014-06-19

5.08 2014-06-17
- Added reset method to Mojo::IOLoop.
Expand Down
6 changes: 3 additions & 3 deletions lib/Mojolicious/Controller.pm
Expand Up @@ -736,9 +736,9 @@ method does not protect from traversing to parent directories.
my $output = $c->render_to_string('foo/index', format => 'pdf');
Try to render content and return it, all arguments get localized automatically
and are only available during this render operation, takes the same arguments
as L</"render">.
Try to render content and return it or return C<undef>, all arguments get
localized automatically and are only available during this render operation,
takes the same arguments as L</"render">.
=head2 rendered
Expand Down
2 changes: 2 additions & 0 deletions t/mojolicious/app.t
Expand Up @@ -63,6 +63,8 @@ is $t->app->secrets->[0], $t->app->moniker, 'secret defaults to moniker';
is $t->app->renderer->template_handler(
{template => 'foo/bar/index', format => 'html'}), 'epl', 'right handler';
is $t->app->build_controller->req->url, '', 'no URL';
is $t->app->build_controller->render_to_string('does_not_exist'), undef,
'no result';

# Missing methods and functions (AUTOLOAD)
eval { $t->app->missing };
Expand Down

0 comments on commit 7e6ad47

Please sign in to comment.