Skip to content

Instantly share code, notes, and snippets.

@geerteltink
Created November 1, 2014 21:33
Show Gist options
  • Save geerteltink/05fbf89f25111618488d to your computer and use it in GitHub Desktop.
Save geerteltink/05fbf89f25111618488d to your computer and use it in GitHub Desktop.
Symfony 2.4 flash messages
<ul class="list-unstyled container js-notifications">
{% if app.session and app.session.flashbag %}
{% for label, flashes in app.session.flashbag.all %}
{% for flash in flashes %}
<li class="alert alert-{{ label }} alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
{{ flash }}
</li>
{% endfor %}
{% endfor %}
{% endif %}
{% block notifications %}{% endblock notifications %}
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment