File tree Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -457,14 +457,23 @@ read any flash messages from the session using ``app.flashes()``:
457
457
458
458
{# templates/base.html.twig #}
459
459
460
- {# you can read and display just one flash message type... #}
460
+ {# read and display just one flash message type #}
461
461
{% for message in app.flashes('notice') %}
462
462
<div class="flash-notice">
463
463
{{ message }}
464
464
</div>
465
465
{% endfor %}
466
466
467
- {# ...or you can read and display every flash message available #}
467
+ {# read and display several types of flash messages #}
468
+ {% for label, messages in app.flashes(['success', 'warning']) %}
469
+ {% for message in messages %}
470
+ <div class="flash-{{ label }}">
471
+ {{ message }}
472
+ </div>
473
+ {% endfor %}
474
+ {% endfor %}
475
+
476
+ {# read and display all flash messages #}
468
477
{% for label, messages in app.flashes %}
469
478
{% for message in messages %}
470
479
<div class="flash-{{ label }}">
Original file line number Diff line number Diff line change @@ -138,7 +138,7 @@ Don't forget to update the ``example.com/src/app.php`` file accordingly::
138
138
139
139
$routes->add('leap_year', new Routing\Route('/is_leap_year/{year}', [
140
140
'year' => null,
141
- '_controller' => 'Calendar\Controller\LeapYearController::indexAction ',
141
+ '_controller' => 'Calendar\Controller\LeapYearController::index ',
142
142
]));
143
143
144
144
To sum up, here is the new file layout:
Original file line number Diff line number Diff line change @@ -122,6 +122,7 @@ a traditional HTML form that submits to ``/login``:
122
122
123
123
use App\Entity\User;
124
124
use Doctrine\ORM\EntityManagerInterface;
125
+ use Symfony\Component\Security\Core\Exception\CustomUserMessageAuthenticationException;
125
126
use Symfony\Component\HttpFoundation\RedirectResponse;
126
127
use Symfony\Component\HttpFoundation\Request;
127
128
use Symfony\Component\Routing\RouterInterface;
You can’t perform that action at this time.
0 commit comments