The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Message::Stack::Message - A Message

SYNOPSIS

  my $stack = Message::Stack->new;

  $stack->add(
    Message::Stack::Message->new(
        id => '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.

ATTRIBUTES

id

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.

AUTHOR

Cory G Watson, <gphat at cpan.org>

COPYRIGHT & LICENSE

Copyright 2009 Cory G Watson, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.