Mojolic...::Plugin(3)

πŸ’… NAME πŸ’…

Mojolicious::Plugin β€” the plugin base class, bestie. It's giving "parent energy" for every Mojolicious plugin out there. 🫢

(This cutie lives in section 3 of the perl manual β€” user contributed perl documentation, iykyk ✨)


🌸 SYNOPSIS 🌸

# CamelCase plugin name
package Mojolicious::Plugin::MyPlugin;
use Mojo::Base 'Mojolicious::Plugin', -signatures;

sub register ($self, $app, $conf) {

  # Magic here! :)
}

That's literally it. You inherit, you write a register sub, you do your little magic. Slay. πŸ”₯


πŸ¦‹ DESCRIPTION πŸ¦‹

Mojolicious::Plugin is an abstract base class for Mojolicious plugins. No cap β€” abstract, so you're not supposed to instantiate it directly, you subclass it and make it iconic in your own way. πŸ‘‘

Also: if you wanna see the plugins that are available by default, go look at "PLUGINS" in Mojolicious::Plugins. The whole starter pack is listed there. πŸ’–


✨ METHODS ✨

Mojolicious::Plugin inherits all methods from Mojo::Base (yes, all of them, it's a whole inheritance moment) and implements this one new method:

πŸŽ€ register

$plugin->register(Mojolicious->new);
$plugin->register(Mojolicious->new, {foo => 'bar'});

So here's the tea: this method gets called by Mojolicious::Plugins at startup time. It is meant to be overloaded in a subclass β€” like, that's its whole purpose, bestie. You're supposed to write your own version. Don't just leave it sitting there doing nothing. πŸ™ˆ


🌈 SEE ALSO 🌈


⭐ Quick vibe check: it's an abstract base class, so don't go calling Mojolicious::Plugin->new and expecting a whole personality. Subclass it, overload register, live your truth. πŸ’…

Okay that's the whole page, you ate that πŸ“ β€” this was Mojolic...::Plugin(3) (the Mojolicious::Plugin manpage, truncated name and all 😭) from the User Contributed Perl Documentation, generated by perl v5.42.0 on 2026-07-15. Go forth and plugin, main character. πŸ§šπŸ’œ

πŸ“¦ where this page comes from