Created
October 9, 2012 09:50
-
-
Save messyOne/3857698 to your computer and use it in GitHub Desktop.
ZfcUserMod for DluTwBootstrap
This file contains 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
<?php | |
namespace ZfcUserMod; | |
/** | |
* Description of Module | |
* | |
* @author messy | |
*/ | |
class Module | |
{ | |
public function init(\Zend\ModuleManager\ModuleManager $moduleManager) | |
{ | |
$sharedEvents = $moduleManager->getEventManager()->getSharedManager(); | |
$sharedEvents->attach('ZfcUser', 'dispatch', array($this, 'onModuleDispatch')); | |
} | |
public function onModuleDispatch(\Zend\Mvc\MvcEvent $e) | |
{ | |
//Set the main menu into the layout view model | |
$serviceManager = $e->getApplication()->getServiceManager(); | |
$navbarContainer = $serviceManager->get('loo_navigation'); | |
$viewModel = $e->getViewModel(); | |
$viewModel->setVariable('navbar', $navbarContainer); | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment