Mojolicious::Plugin(3pm)

Mojolicious::Plugin3pm

Plugin base class

Usage

  # CamelCase plugin name
  package Mojolicious::Plugin::MyPlugin;
  use Mojo::Base 'Mojolicious::Plugin', -signatures;
  sub register ($self, $app, $conf) {
    # Magic here! :)
  }

Overview

Mojolicious::Plugin is an abstract base class for Mojolicious plugins.

See "PLUGINS" in Mojolicious::Plugins for a list of plugins that are available by default.

Methods

Mojolicious::Plugin inherits all methods from Mojo::Base and implements the following new ones.

register

  $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.

Releases

8 releases since Debian 6.0 (Squeeze); the text changed 7 times.

  1. 6.0
  2. 7
  3. 8
  4. 9
  5. 10
  6. 11
  7. 12
  8. 13

From libmojolicious-perl 9.39+dfsg-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.