@@ -40,7 +40,7 @@ Each firewall context can define its own custom access denied handler:
4040 ));
4141
4242
43- Your handler must implement the
43+ Your handler must implement the
4444:class: `Symfony\\ Component\\ Security\\ Http\\ Authorization\\ AccessDeniedHandlerInterface `.
4545This interface defines one method called ``handle() `` that implements the logic to
4646execute when access is denied to the current user (send a mail, log a message, or
@@ -78,25 +78,26 @@ Then, register the service for the access denied handler:
7878
7979 .. code-block :: xml
8080
81- <!-- app/config/services.xml -->
82- <?xml version="1.0" encoding="UTF-8" ?>
83- <container xmlns="http://symfony.com/schema/dic/services"
84- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
85- xsi:schemaLocation="http://symfony.com/schema/dic/services
86- http://symfony.com/schema/dic/services/services-1.0.xsd">
81+ <!-- app/config/services.xml -->
82+ <?xml version =" 1.0" encoding =" UTF-8" ?>
83+ <container xmlns =" http://symfony.com/schema/dic/services"
84+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
85+ xsi : schemaLocation =" http://symfony.com/schema/dic/services
86+ http://symfony.com/schema/dic/services/services-1.0.xsd" >
8787
88- <services>
89- <service id="app.security.access_denied_handler"
90- class="AppBundle\S ecurity\A ccessDeniedHandler" />
91- </services>
92- </container>
88+ <services >
89+ <service id =" app.security.access_denied_handler"
90+ class =" AppBundle\Security\AccessDeniedHandler" />
91+ </services >
92+ </container >
9393
9494 .. code-block :: php
9595
96- // app/config/services.php
97- $container->register(
96+ // app/config/services.php
97+ $container->register(
9898 'app.security.access_denied_handler',
99- 'AppBundle\S ecurity\A ccessDeniedHandler'
100- );
99+ 'AppBundle\Security\AccessDeniedHandler'
100+ );
101101
102- That's it! Any ``AccessDeniedException `` thrown by the ``foo `` firewall will now be handled by your service.
102+ That's it! Any ``AccessDeniedException `` thrown by the ``foo `` firewall will now
103+ be handled by your service.
0 commit comments