Dancer::Hook(3pm)
π Dancer::Hook π
okay bestie, so this is Dancer::Hook β the class that lets you mess with hooks in Dancer. it's part of the User Contributed Perl Documentation crew, iykyk π«Ά
β¨ VERSION β¨
we're on version 1.3522, babes π
π SYNOPSIS π
so like, if you're inside a plugin and you want to do the thing:
# inside a plugin
use Dancer::Hook;
Dancer::Hook->register_hooks_name(qw/before_auth after_auth/);
that's it, that's the vibe β¨
πΈ DESCRIPTION πΈ
okay so the whole point of this module: you manipulate hooks with Dancer. that's literally the description, fr fr. hooks = the little spots where code can jump in and do stuff. this class is the plug that makes that happen. π¦
π METHODS π
π« register_hook ($hook_name, [$properties], $code)
attaches a hook at some point, and you can pass a list of properties if you're feeling extra:
hook 'before', {apps => ['main']}, sub {...};
hook 'before' => sub {...};
π Currently supported properties
appsβ an array reference containing apps name. that's the one and only property on the menu rn, bestie.
π« register_hooks_name
this one adds a new hook name, so that application developers can insert some code at this point. it's giving "make space for the girlies to write their own code here" π
package My::Dancer::Plugin;
Dancer::Hook->instance->register_hooks_name(qw/before_auth after_auth/);
π« hook_is_registered
test if a hook with this name has already been registered. vibe check on your hook names, basically. β
π« execute_hooks
execute a list of hooks for some position. go go go, run 'em π₯
π« get_hooks_for
returns the list of coderef registered for a given position. so like, "who's signed up for this spot?" and it tells you π
π§ AUTHORS π§
this module has been written by Alexis Sukrieh and others. shoutout to the others, we see you π«Ά
π LICENSE π
this module is free software and is published under the same terms as Perl itself. free as in, go wild, bestie π
β AUTHOR β
the Dancer Core Developers. icons only, no cap π
π COPYRIGHT AND LICENSE π
this software is copyright (c) 2010 by Alexis Sukrieh.
this is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
ngl that's the exact same energy as the LICENSE section above, but here it is again because copyright said so π
alright bestie, that's the whole page π this was perl v5.40.1, dated 2026-05-05, coming at you straight from the User Contributed Perl Documentation β mwah, slay, periodt πβ¨π
π¦ where this page comes from
- ubuntu stonking: libdancer-perl 1.3522-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms