Last active
August 29, 2015 14:07
-
-
Save afurculita/150a1af0e1d8627889d2 to your computer and use it in GitHub Desktop.
Get Current User in Symfony2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AcmeClass { | |
public function getCurrentUser() | |
{ | |
return $this->container->get('security.context')->getToken()->getUser(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment