title: Cant map route Correctly using Zend Frameworkd 2
body: <p>Here is my dump for route upon which i want to route my app.</p>
  
  <pre><code>[album] =&gt; Array([route] =&gt; Zend\Mvc\Router\Http\Segment Object
                              (
                                  [parts:protected] =&gt; Array
                                      (
                                          [0] =&gt; Array
                                              (
                                                  [0] =&gt; literal
                                                  [1] =&gt; /album
                                              )
                                          [1] =&gt; Array
                                              (
                                                  [0] =&gt; optional
                                                  [1] =&gt; Array
                                                      (
                                                          [0] =&gt; Array
                                                              (
                                                                  [0] =&gt; literal
                                                                  [1] =&gt; /
                                                              )
                                                          [1] =&gt; Array
                                                              (
                                                                  [0] =&gt; parameter
                                                                  [1] =&gt; action
                                                                  [2] =&gt; 
                                                              )
                                                      )
                                              )
                                          [2] =&gt; Array
                                              (
                                                  [0] =&gt; optional
                                                  [1] =&gt; Array
                                                      (
                                                          [0] =&gt; Array
                                                              (
                                                                  [0] =&gt; literal
                                                                  [1] =&gt; /
                                                              )
                                                          [1] =&gt; Array
                                                              (
                                                                  [0] =&gt; parameter
                                                                  [1] =&gt; id
                                                                  [2] =&gt; 
                                                              )
                                                      )
                                              )
                                      )
                                  [regex:protected] =&gt; /album(?:/(?P[a-zA-Z][a-zA-Z0-9_-]*))?(?:/(?P[0-9]+))?
                                  [paramMap:protected] =&gt; Array
                                      (
                                          [param1] =&gt; action
                                          [param2] =&gt; id
                                      )
                                  [defaults:protected] =&gt; Array
                                      (
                                          [controller] =&gt; Album\Controller\Album
                                          [action] =&gt; index
                                      )
                                  [assembledParams:protected] =&gt; Array
                                      (
                                      )
                              )
                          [priority] =&gt; 0
                          [serial] =&gt; 3
                      )
  </code></pre>
  
  <p>But when i try this </p>
  
  <pre><code>  $router = $e-&gt;getRouter();
    $url = $router-&gt;assemble(array(), array('name' =&gt; 'Album\index'));
  </code></pre>
  
  <p>i get following error.</p>
  
  <blockquote>
    <p>Route with name "Album\index" not found</p>
  </blockquote>
  
  <pre><code> Edit: here is route settings from module.config
  
     'router' =&gt; array(
      'routes' =&gt; array(
          'album' =&gt; array(
              'type' =&gt; 'segment',
              'options' =&gt; array(
                  'route' =&gt; '/album[/:action][/:id]',
                  'constraints' =&gt; array(
                      'action' =&gt; '[a-zA-Z][a-zA-Z0-9_-]*',
                      'id' =&gt; '[0-9]+',
                  ),
                  'defaults' =&gt; array(
                      'controller' =&gt; 'Album\Controller\Album',
                      'action' =&gt; 'index',
                  ),
              ),
          ),
      ),
  ),
  </code></pre>
  
  <p>EDIT: As advised i made following changes</p>
  
  <pre><code>  'router' =&gt; array(
      'routes' =&gt; array(
          'album' =&gt; array(
              'type' =&gt; 'segment',
              'options' =&gt; array(
                  'route' =&gt; '/album',
                  'constraints' =&gt; array(
                      'action' =&gt; 'index',
  //                        'id' =&gt; '[0-9]+',
                  ),
                  'defaults' =&gt; array(
                      'controller' =&gt; 'Album\Controller\Album',
                      'action' =&gt; 'index',
                  ),
              ),
              'may_terminate' =&gt; true,
              'child_routes' =&gt; array(
                  'process' =&gt; array(
                      'type' =&gt; 'Segment',
                      'options' =&gt; array(
                          'route' =&gt; '/[:action]',
                          'constraints' =&gt; array(
                              'controller' =&gt; '[a-zA-Z][a-zA-Z0-9_-]*',
                              'action' =&gt; '[a-zA-Z][a-zA-Z0-9_-]*',
                          ),
                          'defaults' =&gt; array(
                          ),
                      ),
                  ),
              ),
          ),
      ),
  ),
  </code></pre>
  
  <p>but now i cant seem to pass index action. I mean the only action of album module visible to me is index and none else can some 1 correct/suggest what must be done?</p>