[zen-24] Added application module default route
authorMatthew Weier O'Phinney <matthew@zend.com>
Mon, 2 Jul 2012 11:50:01 +0000 (06:50 -0500)
committerMatthew Weier O'Phinney <matthew@zend.com>
Mon, 2 Jul 2012 11:50:01 +0000 (06:50 -0500)
- per Akrabat

module/Application/config/module.config.php

index ba2836a..a4136d5 100644 (file)
@@ -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(