Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Mojolicious Twitter Bootstrap Flash/Stash Alerts
use Mojo::ByteStream;
app->helper(alerts => sub {
my $c = shift;
my $html = '';
for my $message (qw|success info error|) {
my $css = "alert alert-$message";
if($c->flash($message)) {
$html .= $c->tag('div', class => $css, $c->flash($message));
if($c->stash($message)) {
$html .= $c->tag('div', class => $css, $c->stash($message));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.