title: Php Zend 2 Route not found
body: <p>I'm creating a new small application with Zend Framework 2 and I've some problem with routes...
  I've created a a new module cloning the Skeleton Module with Git and renaming it "Users". I've added controllers to register a new user, to login and to perform CRUD operations.</p>
  
  <p>This is my module folder structure:</p>
  
  <p><a href="https://i.stack.imgur.com/GEP6p.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GEP6p.png" alt="Folder Structure"></a></p>
  
  <p>and this is my module.config.php file:</p>
  
  <pre><code>&lt;?php
  return array(
      'controllers' =&gt; array(
      'invokables' =&gt; array(
          'Users\Controller\Index' =&gt; 'Users\Controller\IndexController',
          'Users\Controller\Register' =&gt; 'Users\Controller\RegisterController',
          'Users\Controller\Login' =&gt; 'Users\Controller\LoginController',
          'Users\Controller\UserManager' =&gt; 'Users\Controller\UserManagerController',
      ),
      ),
      'router' =&gt; array(
      'routes' =&gt; array(
          'users' =&gt; array(
              'type'    =&gt; 'Literal',
              'options' =&gt; array(
                  // Change this to something specific to your module
                  'route'    =&gt; '/users',
                  'defaults' =&gt; array(
                      // Change this value to reflect the namespace in which
                      // the controllers for your module are found
                      '__NAMESPACE__' =&gt; 'Users\Controller',
                      'controller'    =&gt; 'Index',
                      'action'        =&gt; 'index',
                  ),
              ),
              'may_terminate' =&gt; true,
              'child_routes' =&gt; array(
                  // This route is a sane default when developing a module;
                  // as you solidify the routes for your module, however,
                  // you may want to remove it and replace it with more
                  // specific routes.
                  'login' =&gt; array(
                      'type'    =&gt; 'Segment',
                  'may_terminate' =&gt; true,
                      'options' =&gt; array(
                          'route'    =&gt; '/login[/:action]',
                          'constraints' =&gt; array(
                              'action'     =&gt; '[a-zA-Z][a-zA-Z0-9_-]*',
                          ),
                          'defaults' =&gt; array(
                              'controller' =&gt; 'Users\Controller\Login',
                              'action'     =&gt; 'index',
                          ),                              
                      ),
                  ),
                  'register' =&gt; array(
                      'type'    =&gt; 'Segment',
                      'may_terminate' =&gt; true,
                      'options' =&gt; array(
                          'route'    =&gt; '/register[/:action]',
                          'constraints' =&gt; array(
                              'action'     =&gt; '[a-zA-Z][a-zA-Z0-9_-]*',
                          ),
                          'defaults' =&gt; array(
                              'controller' =&gt; 'Users\Controller\Register',
                              'action'     =&gt; 'index',
                          ),
                      ),
                  ), 
                  'user-manager' =&gt; array(
                      'type'    =&gt; 'Segment',
                      'may_terminate' =&gt; true,
                      'options' =&gt; array(
                          'route'    =&gt; '/user-manager[/:action[/:id]]',
                          'constraints' =&gt; array(
                              'action'     =&gt; '[a-zA-Z][a-zA-Z0-9_-]*',
                              'id'     =&gt; '[a-zA-Z0-9_-]*',
                          ),
                          'defaults' =&gt; array(
                              'controller' =&gt; 'Users\Controller\UserManager',
                              'action'     =&gt; 'index',
                          ),
                      ),
                  ),
              ),
          ),
      ),
      ),
      'view_manager' =&gt; array(
      'template_path_stack' =&gt; array(
          'users' =&gt; __DIR__ . '/../view',
      ),
      ),
  );
  </code></pre>
  
  <p>When I try with my browser the url <em>test.local/users/login</em> or <em>test.local/users/register</em> everything works fine but if I try <em>test.local/users/user-manager</em> I get the following error:</p>
  
  <blockquote>
    <p>Route with name "user-manager" not found</p>
  </blockquote>
  
  <p>whilst with <em>test.local/users/user-manager/edit/5</em> it is rendered the correct page.
  I'm bit confused and I don't know how to solve this problem. </p>
  
  <p>Any help is very appreciated. Thanks in advance.</p>