Created
April 3, 2013 14:16
-
-
Save enricofoltran/5301589 to your computer and use it in GitHub Desktop.
Symfony: display all flash messages in a twig template
This file contains 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
{% if app.session.flashbag.peekAll|length > 0 %} | |
{% for type, messages in app.session.flashbag.all %} | |
{% for message in messages %} | |
<div class="{{ type ? type : '' }}"> | |
{{ message|trans({}, domain|default('messages')) }} | |
</div> | |
{% endfor %} | |
{% endfor %} | |
{% endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment