Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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));
}
}
b($html);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.