Skip to content

Instantly share code, notes, and snippets.

@messyOne
Created October 10, 2012 13:00
Show Gist options
  • Save messyOne/3865519 to your computer and use it in GitHub Desktop.
Save messyOne/3865519 to your computer and use it in GitHub Desktop.
just a test
public function getViewHelperConfig()
{
return array(
'initializers' => array(
function($instance, $viewServiceManager) {
if ($instance instanceof ServiceLocatorAwareInterface) {
$instance->setServiceLocator($viewServiceManager->getServiceLocator());
}
}
),
'factories' => array(
'navigation' => function($sm) {
$navigation = $sm->get('Zend\View\Helper\Navigation');
// get my acl
$acl = $sm->getServiceLocator()->get('BjyAuthorize\Service\Authorize')->getAcl();
$navigation->setAcl($acl);
// set guest role
$navigation->setRole('guest');
return $navigation;
}
)
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment