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
Post a Comment