Skip to content

Instantly share code, notes, and snippets.

@messyOne
Created October 9, 2012 09:50
Show Gist options
  • Save messyOne/3857698 to your computer and use it in GitHub Desktop.
Save messyOne/3857698 to your computer and use it in GitHub Desktop.
ZfcUserMod for DluTwBootstrap
<?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