Skip to content

Commit

Permalink
added example to plugin synopsis
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jul 30, 2012
1 parent 49adce0 commit 0df68ec
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/Mojolicious/Plugin.pm
Expand Up @@ -15,8 +15,17 @@ Mojolicious::Plugin - Plugin base class
=head1 SYNOPSIS
# Camel case plugin name
package Mojolicious::Plugin::MyPlugin;
use Mojo::Base 'Mojolicious::Plugin';
# <suitable Futurama quote here>
sub register {
my ($self, $app, $conf) = @_;
# Magic here! :)
}
=head1 DESCRIPTION
L<Mojolicious::Plugin> is an abstract base class for L<Mojolicious> plugins.
Expand All @@ -28,7 +37,8 @@ the following new ones.
=head2 C<register>
$plugin->register;
$plugin->register(Mojolicious->new);
$plugin->register(Mojolicious->new, {foo => 'bar'});
This method will be called by L<Mojolicious::Plugins> at startup time. Meant
to be overloaded in a subclass.
Expand Down

0 comments on commit 0df68ec

Please sign in to comment.