NAME
Message::Stack::Message - Message!
VERSION
version 0.22
SYNOPSIS
my $stack = Message::Stack->new;
$stack->add(
Message::Stack::Message->new(
msgid => 'I18NName',
level => 'error',
scope => 'loginform',
subject => 'username',
text => 'You forgot a password'
)
);
DESCRIPTION
The Message object formalizes the messages that are added to the stack. None of the fields are required, as it's up to the developer to decide what to use.
NOTES
Note About msgid
msgid used to be id. It was renamed to be a bit more description. All the methods that existed for id still exist and the id attribute is now aliased to msgid. In other words if you create an object using id
then the msgid methods and the id
methods will work, and vice versa.
ATTRIBUTES
msgid
String identifier for this message. Intended for use with gettext or similar I18N mechanisms wherein a message id is used to identity the translated text for a message.
level
String attribute used to describe the level of this message. Intended for use with strings like 'error' or 'info'.
params
An optional ArrayRef of params. This is provided for localization of messages, where id may correspond to a Gettext style string and the params may represent some placeholder values.
scope
String identitying the scope of a message. Used for cases when multiple subsystems might be emitting messages and a mechanism for grouping them is necessary. A common case would be a form with multiple fieldsets.
subject
String identifying the subject of a message. Used to identify a particular element to which this message is pertinent. Common case is an individual field in a form.
text
String containing the human readable form of the message. Often used in situations when I18N is not required.
METHODS
has_msgid
Returns true if this Message has a msgid.
has_level
Returns true if this Message has a level.
has_params
Returns true if this Message has params.
has_scope
Returns true if this Message has a scope.
has_subject
Returns true if this Message has a subject.
has_text
Returns true if this Message has text.
AUTHOR
Cory G Watson <gphat@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2011 by Cory G Watson.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.