Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 26d17e3 commit eb88894Copy full SHA for eb88894
book/security.rst
@@ -1181,6 +1181,16 @@ look like:
1181
$user = $this->get('security.context')->getToken()->getUser();
1182
}
1183
1184
+In a controller this can be shortcut to:
1185
+
1186
+.. code-block:: php
1187
1188
+ public function indexAction()
1189
+ {
1190
+ $user = $this->getUser();
1191
+ }
1192
1193
1194
.. note::
1195
1196
Anonymous users are technically authenticated, meaning that the ``isAuthenticated()``
0 commit comments