php - get the current user in the controller symfony2 -


i want user connected session. mean since can role :

$this->get('security.context')->isgranted('role_admin') 

could user??

you can current user this

$securitycontext = $this->get('security.context'); $user = $securitycontext->gettoken()->getuser(); 

Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -