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