Skip to content

Commit 482d7ad

Browse files
committed
minor #10985 [UI] Flash Message keys (Guikingone)
This PR was merged into the 3.4 branch. Discussion ---------- [UI] Flash Message keys Hi everyone, It seems that the doc lacks the case when we use multiple keys in order to ease the `for` tag. Commits ------- 9516b15 feat(ui): flash message keys added
2 parents 342e391 + 9516b15 commit 482d7ad

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

controller.rst

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,16 @@ read any flash messages from the session using ``app.flashes()``:
546546
</div>
547547
{% endfor %}
548548

549-
{# ...or you can read and display every flash message available #}
549+
{# ...or you can read and display every flash message available for given labels #}
550+
{% for label, messages in app.flashes(['success', 'warning']) %}
551+
{% for message in messages %}
552+
<div class="flash-{{ label }}">
553+
{{ message }}
554+
</div>
555+
{% endfor %}
556+
{% endfor %}
557+
558+
{# ...finally you can read and display every flash message available #}
550559
{% for label, messages in app.flashes %}
551560
{% for message in messages %}
552561
<div class="flash-{{ label }}">

0 commit comments

Comments
 (0)