Created
August 2, 2012 08:43
-
-
Save awartoft/3235505 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Expected to return \Zend\ServiceManager\Config object or array to | |
* seed such an object. | |
* | |
* @return array|\Zend\ServiceManager\Config | |
*/ | |
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'); | |
$navigation->setAcl($sm->getServiceLocator()->get('acl')); | |
$navigation->setRole($sm->getServiceLocator()->get('user_service_auth')->getIdentity()->getRole()); | |
return $navigation; | |
} | |
) | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Why you have added an initializers?