X-Git-Url: http://git.inspyration.org/?a=blobdiff_plain;f=module%2FApplication%2Fconfig%2Fmodule.config.php;h=a4136d5536a11e7d7643fdd0d737d5335571b847;hb=a9e4be85419d45c13a96d9939d5df4c30dfa8cd5;hp=c41595fdd6f81daec1cb4066cf4c51ed6ba74afe;hpb=132c918857c79a998fb100cb9447a18d1f36ff7b;p=zf2.biz%2Fapplication_blanche.git diff --git a/module/Application/config/module.config.php b/module/Application/config/module.config.php index c41595f..a4136d5 100644 --- a/module/Application/config/module.config.php +++ b/module/Application/config/module.config.php @@ -1,77 +1,42 @@ array( - 'instance' => array( - // Inject the plugin broker for controller plugins into - // the action controller for use by all controllers that - // extend it. - 'Zend\Mvc\Controller\ActionController' => array( - 'parameters' => array( - 'broker' => 'Zend\Mvc\Controller\PluginBroker', - ), - ), - 'Zend\Mvc\Controller\PluginBroker' => array( - 'parameters' => array( - 'loader' => 'Zend\Mvc\Controller\PluginLoader', - ), - ), - - // Setup the View layer - 'Zend\View\Resolver\TemplatePathStack' => array( - 'parameters' => array( - 'paths' => array( - 'application' => __DIR__ . '/../view', + 'router' => array( + 'routes' => array( + 'home' => array( + 'type' => 'Zend\Mvc\Router\Http\Literal', + 'options' => array( + 'route' => '/', + 'defaults' => array( + 'controller' => 'Application\Controller\IndexController', + 'action' => 'index', ), ), ), - 'Zend\View\Renderer\PhpRenderer' => array( - 'parameters' => array( - 'resolver' => 'Zend\View\Resolver\TemplatePathStack', - ), - ), - 'Zend\Mvc\View\DefaultRenderingStrategy' => array( - 'parameters' => array( - 'baseTemplate' => 'layout/layout', - ), - ), - 'Zend\Mvc\View\ExceptionStrategy' => array( - 'parameters' => array( - 'displayExceptions' => true, - 'template' => 'error/index', - ), - ), - 'Zend\Mvc\View\RouteNotFoundStrategy' => array( - 'parameters' => array( - 'notFoundTemplate' => 'error/404', + // The following is a route to simplify getting started creating + // new controllers and actions without needing to create a new + // module. Simply drop new controllers in, and you can access them + // using the path /application/:controller/:action + 'application' => array( + 'type' => 'Literal', + 'options' => array( + 'route' => '/application', + 'defaults' => array( + '__NAMESPACE__' => 'Application\Controller', + 'controller' => 'IndexController', + 'action' => 'index', + ), ), - ), - - // 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', - ), + 'may_terminate' => true, + 'child_routes' => array( + 'default' => array( + 'type' => 'Segment', + 'options' => array( + 'route' => '/[:controller[/:action]]', + 'constraints' => array( + 'controller' => '[a-zA-Z][a-zA-Z0-9_-]*', + 'action' => '[a-zA-Z][a-zA-Z0-9_-]*', ), - ), - 'home' => array( - 'type' => 'Zend\Mvc\Router\Http\Literal', - 'options' => array( - 'route' => '/', - 'defaults' => array( - 'controller' => 'Application\Controller\IndexController', - 'action' => 'index', - ), + 'defaults' => array( ), ), ), @@ -79,4 +44,25 @@ return array( ), ), ), + 'controller' => array( + 'classes' => array( + 'Application\Controller\IndexController' => 'Application\Controller\IndexController' + ), + ), + 'view_manager' => array( + 'display_not_found_reason' => true, + 'display_exceptions' => true, + 'doctype' => 'HTML5', + 'not_found_template' => 'error/404', + 'exception_template' => 'error/index', + 'template_map' => array( + 'layout/layout' => __DIR__ . '/../view/layout/layout.phtml', + 'application/index/index' => __DIR__ . '/../view/application/index/index.phtml', + 'error/404' => __DIR__ . '/../view/error/404.phtml', + 'error/index' => __DIR__ . '/../view/error/index.phtml', + ), + 'template_path_stack' => array( + __DIR__ . '/../view', + ), + ), );