title: CakePHP 3: Missing route error for route that exists
body: <p>CakePHP 3.0</p>
  
  <p>I'm getting a "Missing Route" error for a route that exists. </p>
  
  <p>Here are my routes:</p>
  
  <pre><code>#my admin routes...
  Router::prefix('admin', function($routes) {
      $routes-&gt;connect('/', ['controller'=&gt;'Screens', 'action'=&gt;'index']);
      $routes-&gt;connect('/screens', ['controller'=&gt;'Screens', 'action'=&gt;'index']);
      $routes-&gt;connect('/screens/index', ['controller'=&gt;'Screens', 'action'=&gt;'index']);
      //$routes-&gt;fallbacks('InflectedRoute');
  });
  
  Router::scope('/', function ($routes) {
  
      $routes-&gt;connect('/login', ['controller' =&gt; 'Pages', 'action' =&gt; 'display', 'login']);    
      $routes-&gt;connect('/pages/*', ['controller' =&gt; 'Pages', 'action' =&gt; 'display']);
  
      $routes-&gt;fallbacks('InflectedRoute');
  });
  
  Plugin::routes();
  </code></pre>
  
  <p>Basically I just added the top section (for admin routing) to the default routes that come out of the box.</p>
  
  <p>When I visit <code>/admin/screens/index</code> I see the following error:</p>
  
  <p><img src="https://i.stack.imgur.com/nQEay.png" alt="enter image description here"></p>
  
  <p>Notice the error message says: </p>
  
  <blockquote>
    <p>Error: A route matching "array ( 'action' => 'add', 'prefix' =>
    'admin', 'plugin' => NULL, 'controller' => 'Screens', '_ext' => NULL,
    )" could not be found.</p>
  </blockquote>
  
  <p>...which is strange because I am not trying to access the <code>add</code> action. The params printed below look correct.</p>
  
  <p>What is going on?</p>