1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
|
=encoding utf8
=head1 NAME
Dancer2::Plugin::LogReport::Message - extended Log::Report message class
=head1 INHERITANCE
Dancer2::Plugin::LogReport::Message
is a Log::Report::Message
=head1 SYNOPSIS
In your template:
[% FOR message IN messages %]
<div class="alert alert-[% message.bootstrap_color %]">
[% message.toString | html_entity %]
</div>
[% END %]
=head1 DESCRIPTION
[This Dancer2 plugin was contributed by Andrew Beverley]
This class is an extension of L<Log::Report::Message>, with functions
specifically designed for Dancer applications. Minimal functions are
provided (currently only aimed at Bootstrap), but ideas for new ones are
welcome.
Extends L<"DESCRIPTION" in Log::Report::Message|Log::Report::Message/"DESCRIPTION">.
=head1 OVERLOADED
Extends L<"OVERLOADED" in Log::Report::Message|Log::Report::Message/"OVERLOADED">.
=over 4
=item overload: B<""> stringification
Inherited, see L<Log::Report::Message/"OVERLOADED">
=item overload: B<&()> function
Inherited, see L<Log::Report::Message/"OVERLOADED">
=item overload: B<.> concatenation
Inherited, see L<Log::Report::Message/"OVERLOADED">
=back
=head1 METHODS
Extends L<"METHODS" in Log::Report::Message|Log::Report::Message/"METHODS">.
=over 4
=item $obj-E<gt>B<bootstrap_color>()
Get a suitable bootstrap context color for the message. This can be
used as per the SYNOPSIS.
C<success> is used for L<Dancer2::Plugin::LogReport::success()|Dancer2::Plugin::LogReport/"Handlers"> messages,
C<info> colors are used for messages C<notice> and below, C<warning> is used
for C<warning> and C<mistake>, C<danger> is used for all other messages
=item $obj-E<gt>B<reason>()
Get or set the reason of a message
=back
=head1 DETAILS
Extends L<"DETAILS" in Log::Report::Message|Log::Report::Message/"DETAILS">.
=head1 SEE ALSO
This module is part of Log-Report version 1.41,
built on September 11, 2025. Website: F<http://perl.overmeer.net/CPAN/>
=head1 LICENSE
For contributors see file ChangeLog.
This software is copyright (c) 2007-2025 by Mark Overmeer.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
|