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 | |
{ |
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
public function onBootstrap($e) | |
{ | |
$app = $e->getTarget(); | |
$sm = $app->getServiceManager(); | |
$adapter = $sm->get('Zend\Db\Adapter\Adapter'); | |
// adding action for user registration | |
$zfcServiceEvents = $sm->get('zfcuser_user_service')->getEventManager(); | |
$zfcServiceEvents->attach( |
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
public function getViewHelperConfig() | |
{ | |
return array( | |
'initializers' => array( | |
function($instance, $viewServiceManager) { | |
if ($instance instanceof ServiceLocatorAwareInterface) { | |
$instance->setServiceLocator($viewServiceManager->getServiceLocator()); | |
} |
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
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); | |
} |