diff --git a/book/controller.rst b/book/controller.rst index 22a07737648..67ef1a8fbc9 100644 --- a/book/controller.rst +++ b/book/controller.rst @@ -671,7 +671,7 @@ read any flash messages from the session: .. code-block:: html+twig - {% for flash_message in app.session.flashbag.get('notice') %} + {% for flash_message in app.session.flashBag.get('notice') %}
{{ flash_message }}
diff --git a/cookbook/session/avoid_session_start.rst b/cookbook/session/avoid_session_start.rst index 87e798b6313..896ed8dd9c1 100644 --- a/cookbook/session/avoid_session_start.rst +++ b/cookbook/session/avoid_session_start.rst @@ -15,14 +15,14 @@ that a session is *always* started: .. code-block:: html+twig - {% for flashMessage in app.session.flashbag.get('notice') %} + {% for flashMessage in app.session.flashBag.get('notice') %}
{{ flashMessage }}
{% endfor %} Even if the user is not logged in and even if you haven't created any flash messages, -just calling the ``get()`` (or even ``has()``) method of the ``flashbag`` will +just calling the ``get()`` (or even ``has()``) method of the ``flashBag`` will start a session. This may hurt your application performance because all users will receive a session cookie. To avoid this behavior, add a check before trying to access the flash messages: @@ -30,7 +30,7 @@ access the flash messages: .. code-block:: html+twig {% if app.request.hasPreviousSession %} - {% for flashMessage in app.session.flashbag.get('notice') %} + {% for flashMessage in app.session.flashBag.get('notice') %}
{{ flashMessage }}
diff --git a/quick_tour/the_controller.rst b/quick_tour/the_controller.rst index b7dc01b672e..b88027df765 100644 --- a/quick_tour/the_controller.rst +++ b/quick_tour/the_controller.rst @@ -331,7 +331,7 @@ And you can display the flash message in the template like this: .. code-block:: html+twig - {% for flashMessage in app.session.flashbag.get('notice') %} + {% for flashMessage in app.session.flashBag.get('notice') %}
{{ flashMessage }}
@@ -344,4 +344,4 @@ That's all there is to it and I'm not even sure you'll have spent the full 10 minutes. You were briefly introduced to bundles in the first part and all the features you've learned about so far are part of the core FrameworkBundle. But thanks to bundles, everything in Symfony can be extended or replaced. -That's the topic of the :doc:`next part of this tutorial `. \ No newline at end of file +That's the topic of the :doc:`next part of this tutorial `.