A plugin is a module that exports a bunch of symbols to the current namespace (the caller will see all the symbols defined via register).

Note that you have to use the plugin wherever you want to use its symbols. For instance, if you have Webapp::App1 and Webapp::App2, both loaded from your main application, they both need to use FooPlugin if they want to use the symbols exported by FooPlugin.

Configuration for plugin should be structured like this in the config.yml of the application:

plugins:
plugin_name:
key: value

If plugin_setting is called inside a plugin, the appropriate configuration will be returned. The plugin_name should be the name of the package, or, if the plugin name is under the Dancer::Plugin:: namespace (which is recommended), the remaining part of the plugin name.

Enclose the remaining part in quotes if it contains ::, e.g. for Dancer::Plugin::Foo::Bar, use:

To easy migration and interoperability between Dancer 1 and Dancer 2 you can use this method to obtain the arguments or parameters passed to a plugin-defined keyword. Although not relevant for Dancer 1 only, or Dancer 2 only, plugins, it is useful for universal plugins.