Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tyldum/mojolicious-plugin-namedhelpers
Mojolicious-Plugin-NamedHelpers
https://github.com/tyldum/mojolicious-plugin-namedhelpers
Last synced: about 1 month ago
JSON representation
Mojolicious-Plugin-NamedHelpers
- Host: GitHub
- URL: https://github.com/tyldum/mojolicious-plugin-namedhelpers
- Owner: tyldum
- License: artistic-2.0
- Created: 2018-04-18T20:58:49.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-04-19T08:33:19.000Z (over 6 years ago)
- Last Synced: 2024-10-14T02:43:10.291Z (2 months ago)
- Language: Perl
- Size: 29.3 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: Changes
- License: LICENSE
Awesome Lists containing this project
README
[![MetaCPAN Release](https://badge.fury.io/pl/Mojolicious-Plugin-NamedHelpers.svg)](https://metacpan.org/release/Mojolicious-Plugin-NamedHelpers)
# NAMEMojolicious::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](https://metacpan.org/pod/Mojolicious::Plugin::NamedHelpers) is a [Mojolicious](https://metacpan.org/pod/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 identify 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
Vidar Tyldum
# CREDITS
This module is written by Vidar Tyldum, but with crucial help from the #mojo IRC channel on irc.perl.org.
# COPYRIGHT AND LICENSE
This software is Copyright (c) 2018 by Vidar Tyldum.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
# SEE ALSO
[Sub::Util](https://metacpan.org/pod/Sub::Util), [Mojolicious](https://metacpan.org/pod/Mojolicious), [Mojolicious::Guides](https://metacpan.org/pod/Mojolicious::Guides), [http://mojolicious.org](http://mojolicious.org).