8000 #7676 - Flash messages · Pull Request #7684 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content
< 8000 div class="clearfix mt-4 px-3 px-md-4 px-lg-5">

#7676 - Flash messages #7684

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
10000 Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Adding notice about new method.
  • Loading branch information
ricardodevries committed Mar 25, 2017
commit a1af4492eda6aa46ab4368434c3d03241490085b
6 changes: 5 additions & 1 deletion controller.rst
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ read any flash messages from the session:
{# ...or you can read and display every flash message available #}
{% for label, messages in app.flashes %}
{% for message in messages %}
<div class="alert alert-{{ label }}">
<div class="flash-{{ label }}">
{{ message }}
</div>
{% endfor %}
Expand All @@ -451,6 +451,10 @@ read any flash messages from the session:
<?php endforeach ?>
<?php endforeach ?>

.. versionadded:: 3.3
The `app.flashes()` method was introduced in Symfony 3.3. Prior to version 3.3
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unlike Markdown, in RST files we need to use double-backticks for code:

``app.flashes()``

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you had to use `app.session.flashBag`.

.. note::

It's common to use ``notice``, ``warning`` and ``error`` as the keys of the
Expand Down
4 changes: 4 additions & 0 deletions quick_tour/the_controller.rst
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,10 @@ And you can display the flash message in the template like this:
</div>
{% endfor %}

.. versionadded:: 3.3
The `app.flashes()` method was introduced in Symfony 3.3. Prior to version 3.3
you had to use `app.session.flashBag`.

Final Thoughts
--------------

Expand Down
4 changes: 4 additions & 0 deletions session/avoid_session_start.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,7 @@ access the flash messages:
</div>
{% endfor %}
{% endif %}

.. versionadded:: 3.3
The `app.flashes()` method was introduced in Symfony 3.3. Prior to version 3.3
you had to use `app.session.flashBag`.
0