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