Skip to content

Commit ef7061f

Browse files
committed
[#5808] Language tweaks as a I read - Javier improves my language, then I tweak things a little further :)
1 parent d9ff31e commit ef7061f

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

book/controller.rst

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -605,12 +605,11 @@ Flash Messages
605605
~~~~~~~~~~~~~~
606606

607607
You can also store special messages, called "flash" messages, on the user's
608-
session. By design, flash messages are meant to be processed exactly once. This
609-
means that they vanish from the session automatically as soon as they are
610-
retrieved. This feature makes "flash" messages particularly suited for storing
611-
user notifications.
608+
session. By design, flash messages are meant to be used exactly once: they vanish
609+
from the session automatically as soon as you retrieve them. This feature makes
610+
"flash" messages particularly great for storing user notifications.
612611

613-
Consider the following form processing example::
612+
For example, imagine you're processing a form submission::
614613

615614
use Symfony\Component\HttpFoundation\Request;
616615

@@ -635,19 +634,19 @@ Consider the following form processing example::
635634
}
636635

637636
After processing the request, the controller sets a flash message in the session
638-
and then redirects. The message key (``notice`` in this example) can be freely
639-
chosen and is used to retrieve the message content.
637+
and then redirects. The message key (``notice`` in this example) can be anything:
638+
you'll use this key to retrieve the message.
640639

641640
In the template of the next page (or even better, in your base layout template),
642-
the following code will render the messages stored under the ``notice`` key:
641+
read any flash messages from the session::
643642

644643
.. configuration-block::
645644

646645
.. code-block:: html+jinja
647646

648-
{% for flashMessage in app.session.flashbag.get('notice') %}
647+
{% for flash_message in app.session.flashbag.get('notice') %}
649648
<div class="flash-notice">
650-
{{ flashMessage }}
649+
{{ flash_message }}
651650
</div>
652651
{% endfor %}
653652

0 commit comments

Comments
 (0)