events(); $sharedEvents = $events->getSharedManager(); $sharedEvents->attach('bootstrap', 'bootstrap', array($this, 'initializeView'), 100); } public function getAutoloaderConfig() { return array( 'Zend\Loader\ClassMapAutoloader' => array( __DIR__ . '/autoload_classmap.php', ), 'Zend\Loader\StandardAutoloader' => array( 'namespaces' => array( __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__, ), ), ); } public function getConfig() { return include __DIR__ . '/config/module.config.php'; } public function initializeView($e) { $app = $e->getParam('application'); $basePath = $app->getRequest()->getBasePath(); $locator = $app->getLocator(); $renderer = $locator->get('Zend\View\Renderer\PhpRenderer'); $renderer->plugin('basePath')->setBasePath($basePath); } }