X-Git-Url: http://git.inspyration.org/?a=blobdiff_plain;f=module%2FApplication%2Fconfig%2Fmodule.config.php;h=dd2f0d7122b07fa13b1efad39ad81623b4a17620;hb=9f7663fccceeeb7d3b00f6ee32cc5da70d7190c0;hp=6561e263c03407d79cd1f20e565d439cd7b5c726;hpb=628a15da148c720ea548b5e4a01135a22d6b56aa;p=zf2.biz%2Fgalerie.git diff --git a/module/Application/config/module.config.php b/module/Application/config/module.config.php index 6561e26..dd2f0d7 100644 --- a/module/Application/config/module.config.php +++ b/module/Application/config/module.config.php @@ -1,15 +1,17 @@ 'layout/layout.phtml', - 'display_exceptions' => true, - 'di' => array( - 'instance' => array( - 'alias' => array( - 'index' => 'Application\Controller\IndexController', - 'error' => 'Application\Controller\ErrorController', - 'view' => 'Zend\View\PhpRenderer', + 'di' => array( + 'definition' => array( + 'class' => array( + 'Zend\Mvc\Router\RouteStack' => array( + 'instantiator' => array( + 'Zend\Mvc\Router\Http\TreeRouteStack', + 'factory' + ), + ), ), - + ), + 'instance' => array( // Inject the plugin broker for controller plugins into // the action controller for use by all controllers that // extend it. @@ -24,41 +26,79 @@ return array( ), ), - // Setup the PhpRenderer - 'Zend\View\PhpRenderer' => array( + // Setup the View layer + 'Zend\View\Resolver\AggregateResolver' => array( + 'injections' => array( + 'Zend\View\Resolver\TemplateMapResolver', + 'Zend\View\Resolver\TemplatePathStack', + ), + ), + 'Zend\View\Resolver\TemplateMapResolver' => array( 'parameters' => array( - 'resolver' => 'Zend\View\TemplatePathStack', - 'options' => array( - 'script_paths' => array( - 'application' => __DIR__ . '/../view', - ), + 'map' => array( + 'layout/layout' => __DIR__ . '/../view/layout/layout.phtml', ), ), ), - ), - ), - 'routes' => array( - 'default' => array( - 'type' => 'Zend\Mvc\Router\Http\Segment', - 'options' => array( - 'route' => '/[:controller[/:action]]', - 'constraints' => array( - 'controller' => '[a-zA-Z][a-zA-Z0-9_-]*', - 'action' => '[a-zA-Z][a-zA-Z0-9_-]*', + 'Zend\View\Resolver\TemplatePathStack' => array( + 'parameters' => array( + 'paths' => array( + 'application' => __DIR__ . '/../view', + ), + ), + ), + 'Zend\View\Renderer\PhpRenderer' => array( + 'parameters' => array( + 'resolver' => 'Zend\View\Resolver\AggregateResolver', ), - 'defaults' => array( - 'controller' => 'index', - 'action' => 'index', + ), + 'Zend\Mvc\View\DefaultRenderingStrategy' => array( + 'parameters' => array( + 'baseTemplate' => 'layout/layout', ), ), - ), - 'home' => array( - 'type' => 'Zend\Mvc\Router\Http\Literal', - 'options' => array( - 'route' => '/', - 'defaults' => array( - 'controller' => 'index', - 'action' => 'index', + 'Zend\Mvc\View\ExceptionStrategy' => array( + 'parameters' => array( + 'displayExceptions' => true, + 'template' => 'error/index', + ), + ), + 'Zend\Mvc\View\RouteNotFoundStrategy' => array( + 'parameters' => array( + 'notFoundTemplate' => 'error/404', + 'displayNotFoundReason' => true, + ), + ), + + // Setup the router and routes + 'Zend\Mvc\Router\RouteStack' => array( + 'parameters' => array( + 'routes' => array( + 'default' => array( + 'type' => 'Zend\Mvc\Router\Http\Segment', + 'options' => array( + 'route' => '/[:controller[/:action]]', + 'constraints' => array( + 'controller' => '[a-zA-Z][a-zA-Z0-9_-]*', + 'action' => '[a-zA-Z][a-zA-Z0-9_-]*', + ), + 'defaults' => array( + 'controller' => 'Application\Controller\IndexController', + 'action' => 'index', + ), + ), + ), + 'home' => array( + 'type' => 'Zend\Mvc\Router\Http\Literal', + 'options' => array( + 'route' => '/', + 'defaults' => array( + 'controller' => 'Application\Controller\IndexController', + 'action' => 'index', + ), + ), + ), + ), ), ), ),