Skip to content

Commit

Permalink
Mention $app->defaults in routing guide
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Apr 27, 2023
1 parent addf3ca commit db4bcd3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/Mojolicious/Guides/Routing.pod
Expand Up @@ -256,6 +256,10 @@ with whatever data you need to generate a response. Once dispatched the whole st
$self->stash(mymessage => 'Welcome');
}

You can use L<Mojolicious/"defaults"> to set default stash values that will be available everywhere in the application.

$app->defaults(mymessage => 'Howdy');

For a full list of reserved stash values see L<Mojolicious::Controller/"stash">.

=head2 Nested routes
Expand Down

0 comments on commit db4bcd3

Please sign in to comment.