Skip to content

Commit cf7a69a

Browse files
committed
minor #7559 fix usage of the session flag bag API (xabbuh)
This PR was merged into the 2.7 branch. Discussion ---------- fix usage of the session flag bag API completes #7432 and #7557 Commits ------- f050919 fix usage of the session flag bag API
2 parents 532f9f5 + f050919 commit cf7a69a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

controller.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,14 +447,14 @@ read any flash messages from the session:
447447
<!-- app/Resources/views/base.html.php -->
448448

449449
// you can read and display just one flash message type...
450-
<?php foreach ($view['session']->getFlash('notice') as $message): ?>
450+
<?php foreach ($view['session']->getFlashBag()->get('notice') as $message): ?>
451451
<div class="flash-notice">
452452
<?php echo $message ?>
453453
</div>
454454
<?php endforeach ?>
455455

456456
// ...or you can read and display every flash message available
457-
<?php foreach ($view['session']->getFlashes() as $type => $flash_messages): ?>
457+
<?php foreach ($view['session']->getFlashBag()->all() as $type => $flash_messages): ?>
458458
<?php foreach ($flash_messages as $flash_message): ?>
459459
<div class="flash-<?php echo $type ?>">
460460
<?php echo $message ?>

0 commit comments

Comments
 (0)