# CamelCase plugin name package Mojolicious::Plugin::MyPlugin; use Mojo::Base 'Mojolicious::Plugin'; sub register { my ($self, $app, $conf) = @_; # Magic here! :) }
See ``PLUGINS'' in Mojolicious::Plugins for a list of plugins that are available by default.
$plugin->register(Mojolicious->new); $plugin->register(Mojolicious->new, {foo => 'bar'});
This method will be called by Mojolicious::Plugins at startup time. Meant to be overloaded in a subclass.