Updates to 404 handling
[zf2.biz/galerie.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\TemplateMapResolver',
33                     'Zend\View\Resolver\TemplatePathStack',
34                 ),
35             ),
36             'Zend\View\Resolver\TemplateMapResolver' => array(
37                 'parameters' => array(
38                     'map'  => array(
39                         'layout/layout' => __DIR__ . '/../view/layout/layout.phtml',
40                     ),
41                 ),
42             ),
43             'Zend\View\Resolver\TemplatePathStack' => array(
44                 'parameters' => array(
45                     'paths'  => array(
46                         'application' => __DIR__ . '/../view',
47                     ),
48                 ),
49             ),
50             'Zend\View\Renderer\PhpRenderer' => array(
51                 'parameters' => array(
52                     'resolver' => 'Zend\View\Resolver\AggregateResolver',
53                 ),
54             ),
55             'Zend\Mvc\View\DefaultRenderingStrategy' => array(
56                 'parameters' => array(
57                     'layoutTemplate' => 'layout/layout',
58                 ),
59             ),
60             'Zend\Mvc\View\ExceptionStrategy' => array(
61                 'parameters' => array(
62                     'displayExceptions' => true,
63                     'exceptionTemplate' => 'error/index',
64                 ),
65             ),
66             'Zend\Mvc\View\RouteNotFoundStrategy' => array(
67                 'parameters' => array(
68                     'displayNotFoundReason' => true,
69                     'displayExceptions'     => true,
70                     'notFoundTemplate'      => 'error/404',
71                 ),
72             ),
73
74             // Setup the router and routes
75             'Zend\Mvc\Router\RouteStack' => array(
76                 'parameters' => array(
77                     'routes' => array(
78                         'default' => array(
79                             'type'    => 'Zend\Mvc\Router\Http\Segment',
80                             'options' => array(
81                                 'route'    => '/[:controller[/:action]]',
82                                 'constraints' => array(
83                                     'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
84                                     'action'     => '[a-zA-Z][a-zA-Z0-9_-]*',
85                                 ),
86                                 'defaults' => array(
87                                     'controller' => 'Application\Controller\IndexController',
88                                     'action'     => 'index',
89                                 ),
90                             ),
91                         ),
92                         'home' => array(
93                             'type' => 'Zend\Mvc\Router\Http\Literal',
94                             'options' => array(
95                                 'route'    => '/',
96                                 'defaults' => array(
97                                     'controller' => 'Application\Controller\IndexController',
98                                     'action'     => 'index',
99                                 ),
100                             ),
101                         ),
102                     ),
103                 ),
104             ),
105         ),
106     ),
107 );