Skip to content

Commit 57edf91

Browse files
authored
[Security] Add example with PHP attributes for login link
1 parent e4cb911 commit 57edf91

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

security/login_link.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,23 @@ intercept requests to this route:
108108
throw new \LogicException('This code should never be reached');
109109
}
110110
}
111+
112+
.. code-block:: php-attributes
113+
114+
// src/Controller/SecurityController.php
115+
namespace App\Controller;
116+
117+
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
118+
use Symfony\Component\Routing\Annotation\Route;
119+
120+
class SecurityController extends AbstractController
121+
{
122+
#[Route('/login_check', name: 'login_check')]
123+
public function check()
124+
{
125+
throw new \LogicException('This code should never be reached');
126+
}
127+
}
111128
112129
.. code-block:: yaml
113130

0 commit comments

Comments
 (0)