From 57edf91e2d42a4280f243f0050449a5dfa0bde01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Isaert?= Date: Tue, 16 Nov 2021 12:30:09 +0100 Subject: [PATCH] [Security] Add example with PHP attributes for login link --- security/login_link.rst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/security/login_link.rst b/security/login_link.rst index e5680ea5de3..86406f9b316 100644 --- a/security/login_link.rst +++ b/security/login_link.rst @@ -108,6 +108,23 @@ intercept requests to this route: throw new \LogicException('This code should never be reached'); } } + + .. code-block:: php-attributes + + // src/Controller/SecurityController.php + namespace App\Controller; + + use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; + use Symfony\Component\Routing\Annotation\Route; + + class SecurityController extends AbstractController + { + #[Route('/login_check', name: 'login_check')] + public function check() + { + throw new \LogicException('This code should never be reached'); + } + } .. code-block:: yaml