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 π
MojoliciousMojolicious::Guides- <https://mojolicious.org>
β Quick vibe check: it's an abstract base class, so don't go callingMojolicious::Plugin->newand expecting a whole personality. Subclass it, overloadregister, 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
- opensuse-leap 16.0: perl-Mojolicious 9.480.0-bp160.2.1 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms