Working view layer integration
[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                     'options'  => array(
41                         'script_paths' => array(
42                             'application' => __DIR__ . '/../view',
43                         ),
44                     ),
45                 ),
46             ),
47             'Zend\View\Renderer\PhpRenderer' => array(
48                 'parameters' => array(
49                     'resolver' => 'Zend\View\Resolver\TemplatePathStack',
50                 ),
51             ),
52             'Zend\Mvc\View\DefaultRenderingStrategy' => array(
53                 'parameters' => array(
54                     'baseTemplate' => 'layout/layout.phtml',
55                 ),
56             ),
57             'Zend\Mvc\View\ExceptionStrategy' => array(
58                 'parameters' => array(
59                     'displayExceptions' => true,
60                     'errorTemplate'     => 'error/index.phtml',
61                 ),
62             ),
63             'Zend\Mvc\View\RouteNotFoundStrategy' => array(
64                 'parameters' => array(
65                     'notFoundTemplate' => 'error/404.phtml',
66                 ),
67             ),
68
69             // Setup the router and routes
70             'Zend\Mvc\Router\RouteStack' => array(
71                 'parameters' => array(
72                     'routes' => array(
73                         'default' => array(
74                             'type'    => 'Zend\Mvc\Router\Http\Segment',
75                             'options' => array(
76                                 'route'    => '/[:controller[/:action]]',
77                                 'constraints' => array(
78                                     'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
79                                     'action'     => '[a-zA-Z][a-zA-Z0-9_-]*',
80                                 ),
81                                 'defaults' => array(
82                                     'controller' => 'index',
83                                     'action'     => 'index',
84                                 ),
85                             ),
86                         ),
87                         'home' => array(
88                             'type' => 'Zend\Mvc\Router\Http\Literal',
89                             'options' => array(
90                                 'route'    => '/',
91                                 'defaults' => array(
92                                     'controller' => 'index',
93                                     'action'     => 'index',
94                                 ),
95                             ),
96                         ),
97                     ),
98                 ),
99             ),
100         ),
101     ),
102 );