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 -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -