| Form-Factory documentation | Contained in the Form-Factory distribution. |
Form::Factory::Feature::Role::CustomMessage - features with custom messages
version 0.020
A feature may consume this role in order to allow the user to specify a custom message on failure.
This is a custom error message for failures. This message is used instead of the one the feature specifies when feature_info, feature_warning, and feature_error are called.
This is inadequate. It should be fixed in the future.
$feature->feature_info($message);
Record an info feature message.
$feature->feature_warning($message);
Record a warning feature message.
$feature->feature_error($message);
Record an error feature message.
Andrew Sterling Hanenkamp <hanenkamp@cpan.org>
Copyright 2009 Qubling Software LLC.
This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself.
| Form-Factory documentation | Contained in the Form-Factory distribution. |
package Form::Factory::Feature::Role::CustomMessage; BEGIN { $Form::Factory::Feature::Role::CustomMessage::VERSION = '0.020'; } use Moose::Role;
has message => ( is => 'ro', isa => 'Str', predicate => 'has_message', );
sub feature_info { my $self = shift; my $message = $self->message || shift; $self->result->info($message); }
sub feature_warning { my $self = shift; my $message = $self->message || shift; $self->result->warning($message); }
sub feature_error { my $self = shift; my $message = $self->message || shift; $self->result->error($message); }
1;