Mojolicious::Plugin::MoreHTMLHelpers - Some general helpers
version 0.01
In your startup:
startup
sub startup { my $self = shift; # do some Mojolicious stuff $self->plugin( 'MoreHTMLHelpers' ); # more Mojolicious stuff }
In your template:
<span style="color: <% textcolor('#135713') %>">Any text</span>
This plugin adds a helper method to your web application:
This method requires at least one parameter: The color the text color is based on. The text color should have a contrast to the background color. In web apps where the user can define its own color set, it's necessary to calculate the textcolor on the fly. This is what this helper is for.
<span style="background-color: #135713; color: <% textcolor('#135713') %>">Any text</span>
Called when registering the plugin. On creation, the plugin accepts a hashref to configure the plugin.
# load plugin, alerts are dismissable by default $self->plugin( 'MoreHTMLHelpers' );
Renee Baecker <reneeb@cpan.org>
This software is Copyright (c) 2015 by Renee Baecker.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
1 POD Error
The following errors were encountered while parsing the POD:
=back without =over
To install Mojolicious::Plugin::MoreHTMLHelpers, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mojolicious::Plugin::MoreHTMLHelpers
CPAN shell
perl -MCPAN -e shell install Mojolicious::Plugin::MoreHTMLHelpers
For more information on module installation, please visit the detailed CPAN module installation guide.