zend framework2 - How can i get user role in my actions -


i using zf2 2 modules (zfc-user, bjyauthorize) , want user role actions

try this

in controller

$viewmodel = new viewmodel(); $authorize = $this->getservicelocator()->get('bjyauthorize\provider\identity\providerinterface'); $roles = $authorize->getidentityroles();  $viewmodel->setvariable("roles", $roles); return $viewmodel; 

in view script

<?php var_dump($this->roles); ?> 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Socket.connect doesn't throw exception in Android -

iphone - How do I keep MDScrollView from truncating my row headers and making my cells look bad? -