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

CatalystX::FeedbackMessages - Easy way to stuff "status" messages into your stash

VERSION

version 0.0603

SYNOPSIS

use Catalyst qw/
    ...
+CatalystX::FeedbackMessages
/;

# later...

package MyApp::Controller::Blargh;
...

sub fnargh : Local {
    my ($self, $c) = @_;
    ## do some form submission stuff
    if( $form_stuff_is_successful ) {
        $c->msg("Successful submission is successful!");
    }
}

Open up your wrapper and add these lines:

[% FOR message IN messages -%]
    [% message %]
[% END -%]

(Add formatting as you please)

DESCRIPTION

This module was inspired while working with Mischa Spiegelmock on a Catalyst project. He had put together a small plugin/mixin (astonishingly similar to this one :-) that allowed you to add an arbitrary number of messages to $c-stash> via an arrayref which could be iterated through by Template::Toolkit.

METHODS

msgs $message

Push a message into the array

CONFIGURATION

None, yet.

AUTHORS

Devin Austin, <dhoss@cpan.org>

With thanks to Mischa Spiegelmock

TODO

Allow user to specify names for message keys

SEE ALSO

I dunno :-)

COPYRIGHT & LICENSE

Copyright (c) 2005-2008 the aforementioned authors. All rights
reserved. This program is free software; you can redistribute
it and/or modify it under the same terms as Perl itself.