Skip to content
Peter Mottram edited this page Jul 22, 2015 · 1 revision
use Dancer::Plugin::FlashNote;
flash success => "Some message that should appear in alerts panel.";
flash success => "Another message.";
flash error => "Something bad happened.";

This would result in the following being added to template token flash:

{
  success => [
    { message => "Some message that should appear in alerts panel." },
    { message => "Another message." },
  ],
  error => [
    { message => "Something bad happened." },
  ],
}

The following keys are consumed by the main alerts panel:

  • success
  • info
  • warning
  • error

The message in the panel will be preceded by "Success! " or similar based on the key.

Other keys can be set but then these must be processed elsewhere in a template.

Clone this wiki locally