Skip to content

Instantly share code, notes, and snippets.

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);
}
@messyOne
messyOne / Module.php
Created October 10, 2012 13:00
just a test
public function getViewHelperConfig()
{
return array(
'initializers' => array(
function($instance, $viewServiceManager) {
if ($instance instanceof ServiceLocatorAwareInterface) {
$instance->setServiceLocator($viewServiceManager->getServiceLocator());
}
@messyOne
messyOne / Module.php
Created October 10, 2012 09:17
Insert user_id in user_role_linker
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(
@messyOne
messyOne / Module.php
Created October 9, 2012 09:50
ZfcUserMod for DluTwBootstrap
<?php
namespace ZfcUserMod;
/**
* Description of Module
*
* @author messy
*/
class Module
{