8000 Improved the code used to display flash notices · symfony/symfony-docs@c2676ae · GitHub
[go: up one dir, main page]

Skip to content

Commit c2676ae

Browse files
javiereguiluzwouterj
authored andcommitted
Improved the code used to display flash notices
1 parent 176cdc6 commit c2676ae

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

quick_tour/the_controller.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,9 +330,11 @@ And you can display the flash message in the template like this:
330330

331331
.. code-block:: html+jinja
332332

333-
<div>
334-
{{ app.session.flashbag.get('notice')[0] }}
335-
</div>
333+
{% for flashMessage in app.session.flashbag.get('notice') %}
334+
<div class="flash-notice">
335+
{{ flashMessage }}
336+
</div>
337+
{% endfor %}
336338

337339
Final Thoughts
338340
--------------

0 commit comments

Comments
 (0)
0