Skip to content

Commit

Permalink
documentation tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Aug 10, 2014
1 parent 9f3f7ba commit 9a876c6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions lib/Mojolicious/Guides/Rendering.pod
Expand Up @@ -895,7 +895,7 @@ escaping.
% end

Similar to stash values you can use a prefix like C<myapp.*> to keep helpers
from getting exposed to templates and organize them into namespaces when your
from getting exposed to templates and to organize them into namespaces as your
application grows. Every prefix automatically becomes a helper that returns a
proxy object on which you can call the nested helpers.

Expand All @@ -906,7 +906,7 @@ proxy object on which you can call the nested helpers.
$c->res->headers->cache_control('private, max-age=0, no-cache');
};

helper 'cache_control.five_mins' => sub {
helper 'cache_control.five_minutes' => sub {
my $c = shift;
$c->res->headers->cache_control('public, max-age=300');
};
Expand All @@ -919,7 +919,7 @@ proxy object on which you can call the nested helpers.

get '/some_older_story' => sub {
my $c = shift;
$c->cache_control->five_mins;
$c->cache_control->five_minutes;
$c->render(text => 'This one can be cached for a bit.');
};

Expand Down
5 changes: 2 additions & 3 deletions lib/Mojolicious/Renderer.pm
@@ -1,6 +1,7 @@
package Mojolicious::Renderer;
use Mojo::Base -base;

use Carp ();
use File::Spec::Functions 'catfile';
use Mojo::Cache;
use Mojo::JSON 'encode_json';
Expand Down Expand Up @@ -75,7 +76,7 @@ sub get_helper {

my $lookup = $self->{lookup} ||= {};
return undef unless $lookup->{$name} || grep {/^\Q$name\E\./} keys %$helpers;
$lookup->{$name} = 1;
$lookup->{$name} ||= 1;
return sub { Mojolicious::Renderer::_Proxy->new(c => shift, p => $name) };
}

Expand Down Expand Up @@ -254,8 +255,6 @@ sub _render_template {
package Mojolicious::Renderer::_Proxy;
use Mojo::Base -base;

use Carp ();

sub AUTOLOAD {
my $self = shift;

Expand Down

0 comments on commit 9a876c6

Please sign in to comment.