@@ -605,12 +605,11 @@ Flash Messages
605605~~~~~~~~~~~~~~
606606
607607You 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
637636After 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
641640In 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