Removed obsolete lines.
[zf2.biz/galerie.git] / module / Application / Module.php
1 <?php
2
3 namespace Application;
4
5 use Zend\Module\Manager,
6     Zend\EventManager\StaticEventManager,
7     Zend\Module\Consumer\AutoloaderProvider;
8
9 class Module implements AutoloaderProvider
10 {
11     public function init(Manager $moduleManager)
12     {
13         $events = StaticEventManager::getInstance();
14         $events->attach('bootstrap', 'bootstrap', array($this, 'initializeView'), 100);
15     }
16
17     public function getAutoloaderConfig()
18     {
19         return array(
20             'Zend\Loader\ClassMapAutoloader' => array(
21                 __DIR__ . '/autoload_classmap.php',
22             ),
23             'Zend\Loader\StandardAutoloader' => array(
24                 'namespaces' => array(
25                     __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
26                 ),
27             ),
28         );
29     }
30
31     public function getConfig()
32     {
33         return include __DIR__ . '/config/module.config.php';
34     }
35     
36     public function initializeView($e)
37     {
38         $app          = $e->getParam('application');
39         $basePath     = $app->getRequest()->getBasePath();
40         $locator      = $app->getLocator();
41         $renderer     = $locator->get('Zend\View\Renderer\PhpRenderer');
42         $renderer->plugin('url')->setRouter($app->getRouter());
43         $renderer->doctype()->setDoctype('HTML5');
44         $renderer->plugin('basePath')->setBasePath($basePath);
45     }
46 }