2ae21f013c0239094e7a75e5137132f754d94e02
[zf2.biz/application_blanche.git] / module / Application / config / module.config.php
1 <?php
2 return array(
3     'di' => array(
4         'definition' => array(
5             'class' => array(
6                 'Zend\Mvc\Router\RouteStack' => array(
7                     'instantiator' => array(
8                         'Zend\Mvc\Router\Http\TreeRouteStack',
9                         'factory'
10                     ),
11                 ),
12             ),
13         ),
14         'instance' => array(
15             // Inject the plugin broker for controller plugins into
16             // the action controller for use by all controllers that
17             // extend it.
18             'Zend\Mvc\Controller\ActionController' => array(
19                 'parameters' => array(
20                     'broker'       => 'Zend\Mvc\Controller\PluginBroker',
21                 ),
22             ),
23             'Zend\Mvc\Controller\PluginBroker' => array(
24                 'parameters' => array(
25                     'loader' => 'Zend\Mvc\Controller\PluginLoader',
26                 ),
27             ),
28
29             // Setup the View layer
30             'Zend\View\Resolver\AggregateResolver' => array(
31                 'injections' => array(
32                     'Zend\View\Resolver\TemplatePathStack',
33                 ),
34             ),
35             'Zend\View\Resolver\TemplatePathStack' => array(
36                 'parameters' => array(
37                     'paths'  => array(
38                         'application' => __DIR__ . '/../view',
39                     ),
40                 ),
41             ),
42             'Zend\View\Renderer\PhpRenderer' => array(
43                 'parameters' => array(
44                     'resolver' => 'Zend\View\Resolver\AggregateResolver',
45                 ),
46             ),
47             'Zend\Mvc\View\DefaultRenderingStrategy' => array(
48                 'parameters' => array(
49                     'baseTemplate' => 'layout/layout',
50                 ),
51             ),
52             'Zend\Mvc\View\ExceptionStrategy' => array(
53                 'parameters' => array(
54                     'displayExceptions' => true,
55                     'template'          => 'error/index',
56                 ),
57             ),
58             'Zend\Mvc\View\RouteNotFoundStrategy' => array(
59                 'parameters' => array(
60                     'notFoundTemplate' => 'error/404',
61                 ),
62             ),
63
64             // Setup the router and routes
65             'Zend\Mvc\Router\RouteStack' => array(
66                 'parameters' => array(
67                     'routes' => array(
68                         'default' => array(
69                             'type'    => 'Zend\Mvc\Router\Http\Segment',
70                             'options' => array(
71                                 'route'    => '/[:controller[/:action]]',
72                                 'constraints' => array(
73                                     'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
74                                     'action'     => '[a-zA-Z][a-zA-Z0-9_-]*',
75                                 ),
76                                 'defaults' => array(
77                                     'controller' => 'Application\Controller\IndexController',
78                                     'action'     => 'index',
79                                 ),
80                             ),
81                         ),
82                         'home' => array(
83                             'type' => 'Zend\Mvc\Router\Http\Literal',
84                             'options' => array(
85                                 'route'    => '/',
86                                 'defaults' => array(
87                                     'controller' => 'Application\Controller\IndexController',
88                                     'action'     => 'index',
89                                 ),
90                             ),
91                         ),
92                     ),
93                 ),
94             ),
95         ),
96     ),
97 );