Updated to latest view-layer changes
[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                     'baseTemplate' => 'layout/layout',
58                 ),
59             ),
60             'Zend\Mvc\View\ExceptionStrategy' => array(
61                 'parameters' => array(
62                     'displayExceptions' => true,
63                     'template'          => 'error/index',
64                 ),
65             ),
66             'Zend\Mvc\View\RouteNotFoundStrategy' => array(
67                 'parameters' => array(
68                     'notFoundTemplate' => 'error/404',
69                     'displayNotFoundReason' => true,
70                 ),
71             ),
72
73             // Setup the router and routes
74             'Zend\Mvc\Router\RouteStack' => array(
75                 'parameters' => array(
76                     'routes' => array(
77                         'default' => array(
78                             'type'    => 'Zend\Mvc\Router\Http\Segment',
79                             'options' => array(
80                                 'route'    => '/[:controller[/:action]]',
81                                 'constraints' => array(
82                                     'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
83                                     'action'     => '[a-zA-Z][a-zA-Z0-9_-]*',
84                                 ),
85                                 'defaults' => array(
86                                     'controller' => 'Application\Controller\IndexController',
87                                     'action'     => 'index',
88                                 ),
89                             ),
90                         ),
91                         'home' => array(
92                             'type' => 'Zend\Mvc\Router\Http\Literal',
93                             'options' => array(
94                                 'route'    => '/',
95                                 'defaults' => array(
96                                     'controller' => 'Application\Controller\IndexController',
97                                     'action'     => 'index',
98                                 ),
99                             ),
100                         ),
101                     ),
102                 ),
103             ),
104         ),
105     ),
106 );