package Mojolicious::Plugin; use Mojo::Base -base; use Carp 'croak'; sub register { croak 'Method "register" not implemented by subclass' } 1; =encoding utf8 =head1 NAME Mojolicious::Plugin - Plugin base class =head1 SYNOPSIS # CamelCase plugin name package Mojolicious::Plugin::MyPlugin; use Mojo::Base 'Mojolicious::Plugin'; sub register { my ($self, $app, $conf) = @_; # Magic here! :) } =head1 DESCRIPTION L is an abstract base class for L plugins. =head1 METHODS L inherits all methods from L and implements the following new ones. =head2 register $plugin->register(Mojolicious->new); $plugin->register(Mojolicious->new, {foo => 'bar'}); This method will be called by L at startup time. Meant to be overloaded in a subclass. =head1 SEE ALSO L, L, L. =cut