Created
October 25, 2012 18:00
-
-
Save jmolivas/3954344 to your computer and use it in GitHub Desktop.
Twig template code - Displaying flash messages using bootstrap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{# twig template #} | |
<div class="flash-messages"> | |
{% block flashes %} | |
{% for notice_level in ['success','error','info', 'warning', 'notice'] %} | |
{% if app.session.hasFlash(notice_level) %} | |
<div class="alert alert-{{ notice_level }}"> | |
<a class="close" data-dismiss="alert" href="#">x</a> | |
<h4 class="alert-heading">{{ notice_level }}</h4> | |
{{ app.session.flash(notice_level) }} | |
</div> | |
{% endif %} | |
{% endfor %} | |
{% endblock flashes %} | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment