Skip to content

Commit 720bbc7

Browse files
committed
Merge branch '3.4' into 4.2
* 3.4: feat(ui): flash message keys added Added a brief mention about upgrading custom bundle config to Flex
2 parents c4f64a2 + 08f9501 commit 720bbc7

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

controller.rst

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,14 +457,23 @@ read any flash messages from the session using ``app.flashes()``:
457457

458458
{# templates/base.html.twig #}
459459

460-
{# you can read and display just one flash message type... #}
460+
{# read and display just one flash message type #}
461461
{% for message in app.flashes('notice') %}
462462
<div class="flash-notice">
463463
{{ message }}
464464
</div>
465465
{% endfor %}
466466

467-
{# ...or you can read and display every flash message available #}
467+
{# read and display several types of flash messages #}
468+
{% for label, messages in app.flashes(['success', 'warning']) %}
469+
{% for message in messages %}
470+
<div class="flash-{{ label }}">
471+
{{ message }}
472+
</div>
473+
{% endfor %}
474+
{% endfor %}
475+
476+
{# read and display all flash messages #}
468477
{% for label, messages in app.flashes %}
469478
{% for message in messages %}
470479
<div class="flash-{{ label }}">

0 commit comments

Comments
 (0)