Skip to content

Commit

Permalink
fixed extends, layout and title helpers not to generate unnecessary l…
Browse files Browse the repository at this point in the history
…og messages
  • Loading branch information
kraih committed May 20, 2013
1 parent 57a882f commit dcc4f1f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
4 changes: 4 additions & 0 deletions Changes
@@ -1,4 +1,8 @@

4.02 2013-05-20
- Fixed extends, layout and title helpers not to generate unnecessary log
messages.

4.01 2013-05-19
- Fixed small drain event bug in Mojo::IOLoop::Stream. (ChinaXing)

Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious.pm
Expand Up @@ -41,7 +41,7 @@ has static => sub { Mojolicious::Static->new };
has types => sub { Mojolicious::Types->new };

our $CODENAME = 'Top Hat';
our $VERSION = '4.01';
our $VERSION = '4.02';

sub AUTOLOAD {
my $self = shift;
Expand Down
10 changes: 6 additions & 4 deletions lib/Mojolicious/Plugin/DefaultHelpers.pm
Expand Up @@ -12,13 +12,15 @@ sub register {
$app->helper($name => sub { shift->$name(@_) });
}

# Stash key shortcuts
# Stash key shortcuts (should not generate log messages)
for my $name (qw(extends layout title)) {
$app->helper(
$name => sub {
my $self = shift;
$self->stash($name => @_) if @_;
return $self->stash->{$name};
my $self = shift;
my $stash = $self->stash;
$stash->{$name} = shift if @_;
$self->stash(@_) if @_;
return $stash->{$name};
}
);
}
Expand Down

0 comments on commit dcc4f1f

Please sign in to comment.