Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
mention when get_helper returns undef
  • Loading branch information
kraih committed Aug 10, 2014
1 parent 0b62dab commit 805ef13
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions lib/Mojolicious/Renderer.pm
Expand Up @@ -70,10 +70,7 @@ sub get_data_template {

sub get_helper {
my ($self, $name) = @_;

if (my $helper = $self->helpers->{$name}) { return $helper }
if (my $proxy = $self->{proxy}{$name}) { return $proxy }

if (my $h = $self->helpers->{$name} || $self->{proxy}{$name}) { return $h }
return undef unless grep {/^\Q$name\E\./} keys %{$self->helpers};
return $self->{proxy}{$name}
= sub { Mojolicious::Renderer::_Proxy->new(c => shift, p => $name) };
Expand Down Expand Up @@ -402,8 +399,8 @@ Get a C<DATA> section template by name, usually used by handlers.
my $helper = $renderer->get_helper('url_for');
Get a helper by full name, generate a helper dynamically for a prefix or
return C<undef>. Generated helpers return a proxy object on which nested
helpers can be called.
return C<undef> if no helper or prefix could be found. Generated helpers
return a proxy object on which nested helpers can be called.
=head2 render
Expand Down

0 comments on commit 805ef13

Please sign in to comment.