From: Matthew Weier O'Phinney Date: Mon, 2 Jul 2012 11:50:01 +0000 (-0500) Subject: [zen-24] Added application module default route X-Git-Url: http://git.inspyration.org/?a=commitdiff_plain;h=a9e4be85419d45c13a96d9939d5df4c30dfa8cd5;p=zf2.biz%2Fgalerie.git [zen-24] Added application module default route - per Akrabat --- diff --git a/module/Application/config/module.config.php b/module/Application/config/module.config.php index ba2836a..a4136d5 100644 --- a/module/Application/config/module.config.php +++ b/module/Application/config/module.config.php @@ -7,16 +7,46 @@ return array( 'options' => array( 'route' => '/', 'defaults' => array( - 'controller' => 'index', + 'controller' => 'Application\Controller\IndexController', 'action' => 'index', ), ), ), + // 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', + ), + ), + '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_-]*', + ), + 'defaults' => array( + ), + ), + ), + ), + ), ), ), 'controller' => array( 'classes' => array( - 'index' => 'Application\Controller\IndexController' + 'Application\Controller\IndexController' => 'Application\Controller\IndexController' ), ), 'view_manager' => array(