File tree 1 file changed +1
-23
lines changed
1 file changed +1
-23
lines changed Original file line number Diff line number Diff line change @@ -1890,32 +1890,10 @@ Otherwise, you can enable this behavior yourself by importing the
1890
1890
1891
1891
Another option is to configure ``path `` as a route name, which can be useful if
1892
1892
you want logout URIs to be translated according to the current locale e.g.
1893
- In that case, you have to create this route yourself.
1894
- Note that it doesn't need a controller, because it wouldn't be called anyways:
1893
+ In that case, you have to create this route yourself:
1895
1894
1896
1895
.. configuration-block ::
1897
1896
1898
- .. code-block :: php-attributes
1899
-
1900
- // src/Controller/SecurityController.php
1901
- namespace App\Controller;
1902
-
1903
- use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
1904
- use Symfony\Component\Routing\Annotation\Route;
1905
-
1906
- class SecurityController extends AbstractController
1907
- {
1908
- #[Route([
1909
- 'en' => '/logout',
1910
- 'fr' => '/deconnexion'
1911
- ], name: 'app_logout', methods: ['GET'])]
1912
- public function logout(): never
1913
- {
1914
- // controller can be blank: it will never be called!
1915
- throw new \Exception('Don\'t forget to activate logout in security.yaml');
1916
- }
1917
- }
1918
-
1919
1897
.. code-block :: yaml
1920
1898
1921
1899
# config/routes.yaml
You can’t perform that action at this time.
0 commit comments