how to get current user id zf2

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

how to get current user id zf2

shakams
This post has NOT been accepted by the mailing list yet.
Please help me when i'm trying to get the current user in indexAction() function in My controller i got this message

Zend\Mvc\Controller\PluginManager::get was unable to fetch or create an instance for zfcUserIdentity

i'm using this statement to get the current user id :

$id =(int) $this->zfcUserIdentity()->getid() ;