Skip to content

Commit

Permalink
more stash examples
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jan 17, 2015
1 parent 4c7ce08 commit 1e8bc13
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions lib/Mojolicious/Controller.pm
Expand Up @@ -674,6 +674,9 @@ L</"stash">.
# Render template "foo/bar.*.*"
$c->render(template => 'foo/bar');
# Render template "test.*.*" with arbitrary values "foo" and "bar"
$c->render(template => 'test', foo => 'test', bar => 23);
# Render template "test.xml.*"
$c->render('test', format => 'xml');
Expand Down Expand Up @@ -879,8 +882,8 @@ HMAC-SHA1 signature verification will be automatically discarded.
my $hash = $c->stash;
my $foo = $c->stash('foo');
$c = $c->stash({foo => 'bar'});
$c = $c->stash(foo => 'bar');
$c = $c->stash({foo => 'bar', baz => 'yada'});
$c = $c->stash(foo => 'bar', baz => 'yada');
Non-persistent data storage and exchange for the current request, application
wide default values can be set with L<Mojolicious/"defaults">. Some stash
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious/Plugin/DefaultHelpers.pm
Expand Up @@ -431,7 +431,7 @@ Alias for L<Mojolicious::Controller/"session">.
=head2 stash
%= stash 'foo'
% stash foo => 'bar';
% stash foo => 'bar', baz => 'yada';
Alias for L<Mojolicious::Controller/"stash">.
Expand Down

0 comments on commit 1e8bc13

Please sign in to comment.