Define parameter type in onBootstrap method of Module.php, this will help newcomers...
[zf2.biz/application_blanche.git] / module / Application / Module.php
1 <?php
2 /**
3  * Zend Framework (http://framework.zend.com/)
4  *
5  * @link      http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository
6  * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
7  * @license   http://framework.zend.com/license/new-bsd New BSD License
8  */
9
10 namespace Application;
11
12 use Zend\Mvc\ModuleRouteListener;
13 use Zend\Mvc\MvcEvent;
14
15 class Module
16 {
17     public function onBootstrap(MvcEvent $e)
18     {
19         $e->getApplication()->getServiceManager()->get('translator');
20         $eventManager        = $e->getApplication()->getEventManager();
21         $moduleRouteListener = new ModuleRouteListener();
22         $moduleRouteListener->attach($eventManager);
23     }
24
25     public function getConfig()
26     {
27         return include __DIR__ . '/config/module.config.php';
28     }
29
30     public function getAutoloaderConfig()
31     {
32         return array(
33             'Zend\Loader\StandardAutoloader' => array(
34                 'namespaces' => array(
35                     __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
36                 ),
37             ),
38         );
39     }
40 }