@@ -209,7 +209,7 @@ user to be logged in to access this URL:
209209# ...
210210firewalls :
211211# ...
212-
212+
213213access_control :
214214# require ROLE_ADMIN for /admin*
215215 -{ path: ^/admin, roles: ROLE_ADMIN }
@@ -676,7 +676,7 @@ URL pattern. You saw this earlier, where anything matching the regular expressio
676676# ...
677677firewalls :
678678# ...
679-
679+
680680access_control :
681681# require ROLE_ADMIN for /admin*
682682 -{ path: ^/admin, roles: ROLE_ADMIN }
@@ -870,9 +870,9 @@ in this chapter).
870870 Be careful with this in your layout or on your error pages! Because of
871871 some internal Symfony details, to avoid broken error pages in the ``prod ``
872872 environment, wrap calls in these templates with a check for ``app.user ``:
873-
873+
874874 ..code-block ::html+jinja
875-
875+
876876 {% if app.user and is_granted('ROLE_ADMIN') %}
877877
878878Securing other Services
@@ -1036,7 +1036,7 @@ the User object, and use the ``isGranted`` method (or
10361036
10371037 // boo :(. Never check for the User object to see if they're logged in
10381038 if ($this->getUser()) {
1039-
1039+
10401040 }
10411041
10421042Retrieving the User in a Template
@@ -1055,7 +1055,7 @@ key:
10551055
10561056 ..code-block ::html+php
10571057
1058- <?php if ($view['security']->isGranted('IS_AUTHENTICATED_FULLY')): ?>
1058+ <?php if ($view['security']->isGranted('IS_AUTHENTICATED_FULLY')): ?>
10591059 <p>Username: <?php echo $app->getUser()->getUsername() ?></p>
10601060 <?php endif; ?>
10611061
@@ -1148,7 +1148,7 @@ Next, you'll need to create a route for this URL (but not a controller):
11481148 return $collection;
11491149
11501150 And that's it! By sending a user to ``/logout `` (or whatever you configure
1151- the ``path `` to be), Symfony will un-authenticate the current user. and
1151+ the ``path `` to be), Symfony will un-authenticate the current user. and
11521152redirect them the homepage (the value defined by ``target ``).
11531153
11541154Once the user has been logged out, they will be redirected to whatever path
@@ -1180,6 +1180,9 @@ in the following way from a controller::
11801180
11811181 $user->setPassword($encoded);
11821182
1183+ ..versionadded ::2.6
1184+ The ``security.password_encoder `` service was introduced in Symfony 2.6.
1185+
11831186In order for this to work, just make sure that you have the encoder for your
11841187user class (e.g. ``AppBundle\Entity\User ``) configured under the ``encoders ``
11851188key in ``app/config/security.yml ``.