NAME
Mojolicious::Plugin::NamedHelpers - Mojolicious Plugin
SYNOPSIS
# Mojolicious
$self->plugin('NamedHelpers');
$self->named_helper( my_little_helper => sub { ... } );
# Mojolicious::Lite
plugin 'NamedHelpers';
# Mojolicious::Lite - with custom namespace
plugin 'NamedHelpers' => { namespace => 'My::App::Helpers' };
DESCRIPTION
Mojolicious::Plugin::NamedHelpers is a Mojolicious plugin that sets a fully qualified name to anonymous helper subs using a tiny wrapper upon helper creation. Without this plugin those subs will be named __ANON__, but now they will be named after the helper.
By default the namespace will be the same as the app, but this can be overridden if desired.
The author's use-case is for providing more context in JSON-based application logs, where all helpers would identidy themselves as __ANON__.
HELPERS
named_helper
This plugin provides a new helper called "named_helper".
By registering your helpers with "named_helper" the name of the sub will be set equal to the name of the helper.
AUTHOR
This module is written by Vidar Tyldum, but withcrucial help from the #mojo IRC channel on irc.perl.org.
SEE ALSO
Sub::Util>, Mojolicious, Mojolicious::Guides, http://mojolicious.org.