Skip to content

Plugin - What are $app and $conf and how are they used? #1803

Answered by jhthorsen
ajmetz asked this question in Q&A
Discussion options

You must be logged in to vote

When calling $app->plugin('My::Cool::Plugin', \%config), the $app instance (https://docs.mojolicious.org/Mojolicious) and the hash-ref %config will be passed on as $config.

Instead of %config you can pass on any reference or object, but not a plain scalar.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@ajmetz
Comment options

@jhthorsen
Comment options

Answer selected by ajmetz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants