Updates for ZF2 master changes
[zf2.biz/application_blanche.git] / module / Application / config / module.config.php
1 <?php
2 return array(
3     'di' => array(
4         'instance' => array(
5
6             // Setup for controllers.
7
8             // Injecting the plugin broker for controller plugins into
9             // the action controller for use by all controllers that
10             // extend it
11             'Zend\Mvc\Controller\ActionController' => array(
12                 'parameters' => array(
13                     'broker'       => 'Zend\Mvc\Controller\PluginBroker',
14                 ),
15             ),
16             'Zend\Mvc\Controller\PluginBroker' => array(
17                 'parameters' => array(
18                     'loader' => 'Zend\Mvc\Controller\PluginLoader',
19                 ),
20             ),
21
22             // Setup for router and routes
23             'Zend\Mvc\Router\RouteStackInterface' => array(
24                 'parameters' => array(
25                     'routes' => array(
26                         'default' => array(
27                             'type'    => 'Zend\Mvc\Router\Http\Segment',
28                             'options' => array(
29                                 'route'    => '/[:controller[/:action]]',
30                                 'constraints' => array(
31                                     'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
32                                     'action'     => '[a-zA-Z][a-zA-Z0-9_-]*',
33                                 ),
34                                 'defaults' => array(
35                                     'controller' => 'Application\Controller\IndexController',
36                                     'action'     => 'index',
37                                 ),
38                             ),
39                         ),
40                         'home' => array(
41                             'type' => 'Zend\Mvc\Router\Http\Literal',
42                             'options' => array(
43                                 'route'    => '/',
44                                 'defaults' => array(
45                                     'controller' => 'Application\Controller\IndexController',
46                                     'action'     => 'index',
47                                 ),
48                             ),
49                         ),
50                     ),
51                 ),
52             ),
53
54             // Setup for the view layer.
55
56             // Using the PhpRenderer, which just handles html produced by php 
57             // scripts
58             'Zend\View\Renderer\PhpRenderer' => array(
59                 'parameters' => array(
60                     'resolver' => 'Zend\View\Resolver\AggregateResolver',
61                 ),
62             ),
63             // Defining how the view scripts should be resolved by stacking up
64             // a Zend\View\Resolver\TemplateMapResolver and a
65             // Zend\View\Resolver\TemplatePathStack
66             'Zend\View\Resolver\AggregateResolver' => array(
67                 'injections' => array(
68                     'Zend\View\Resolver\TemplateMapResolver',
69                     'Zend\View\Resolver\TemplatePathStack',
70                 ),
71             ),
72             // Defining where the layout/layout view should be located
73             'Zend\View\Resolver\TemplateMapResolver' => array(
74                 'parameters' => array(
75                     'map'  => array(
76                         'layout/layout' => __DIR__ . '/../view/layout/layout.phtml',
77                     ),
78                 ),
79             ),
80             // Defining where to look for views. This works with multiple paths,
81             // very similar to include_path
82             'Zend\View\Resolver\TemplatePathStack' => array(
83                 'parameters' => array(
84                     'paths'  => array(
85                         'application' => __DIR__ . '/../view',
86                     ),
87                 ),
88             ),
89             // View for the layout
90             'Zend\Mvc\View\DefaultRenderingStrategy' => array(
91                 'parameters' => array(
92                     'layoutTemplate' => 'layout/layout',
93                 ),
94             ),
95             // Injecting the router into the url helper
96             'Zend\View\Helper\Url' => array(
97                 'parameters' => array(
98                     'router' => 'Zend\Mvc\Router\RouteStackInterface',
99                 ),
100             ),
101             // Configuration for the doctype helper
102             'Zend\View\Helper\Doctype' => array(
103                 'parameters' => array(
104                     'doctype' => 'HTML5',
105                 ),
106             ),
107             // View script rendered in case of 404 exception
108             'Zend\Mvc\View\RouteNotFoundStrategy' => array(
109                 'parameters' => array(
110                     'displayNotFoundReason' => true,
111                     'displayExceptions'     => true,
112                     'notFoundTemplate'      => 'error/404',
113                 ),
114             ),
115             // View script rendered in case of other exceptions
116             'Zend\Mvc\View\ExceptionStrategy' => array(
117                 'parameters' => array(
118                     'displayExceptions' => true,
119                     'exceptionTemplate' => 'error/index',
120                 ),
121             ),
122         ),
123     ),
124 );