{"action":"created","issue":{"url":"https://api.github.com/repos/cakephp/cakephp/issues/7764","labels_url":"https://api.github.com/repos/cakephp/cakephp/issues/7764/labels{/name}","comments_url":"https://api.github.com/repos/cakephp/cakephp/issues/7764/comments","events_url":"https://api.github.com/repos/cakephp/cakephp/issues/7764/events","html_url":"https://github.com/cakephp/cakephp/issues/7764","id":119633471,"number":7764,"title":"Route scopes don't work without calling fallbacks();","user":{"login":"timhoeppner","id":3093078,"avatar_url":"https://avatars.githubusercontent.com/u/3093078?v=3","gravatar_id":"","url":"https://api.github.com/users/timhoeppner","html_url":"https://github.com/timhoeppner","followers_url":"https://api.github.com/users/timhoeppner/followers","following_url":"https://api.github.com/users/timhoeppner/following{/other_user}","gists_url":"https://api.github.com/users/timhoeppner/gists{/gist_id}","starred_url":"https://api.github.com/users/timhoeppner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timhoeppner/subscriptions","organizations_url":"https://api.github.com/users/timhoeppner/orgs","repos_url":"https://api.github.com/users/timhoeppner/repos","events_url":"https://api.github.com/users/timhoeppner/events{/privacy}","received_events_url":"https://api.github.com/users/timhoeppner/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-01T03:23:51Z","updated_at":"2015-12-01T04:05:20Z","closed_at":"2015-12-01T04:05:20Z","body":"Simple example, routes.php\r\n\r\n```php\r\nRouter::defaultRouteClass('DashedRoute');\r\n\r\nRouter::scope('/', function ($routes) {\r\n    $routes->connect(\"/test\", [\"controller\" => \"Projects\", \"action\" => \"index\"]);\r\n    $routes->connect(\"/test/:action/*\", [\"controller\" => \"Projects\"]);\r\n});\r\n\r\nPlugin::routes();\r\n```\r\n\r\nopening http://localhost/test results in a routing error and a strange one at that. It reports that it can't find a route for controller \"Requirements\" (another controller in my project). Also, in the debug output, the system is reporting that my /test route exists but for some reason it won't connect. See http://imgur.com/s3cPoYx \r\n\r\nThe only way I can get things to work is by adding a call to fallbacks() as shown below.\r\n\r\n```php\r\nRouter::defaultRouteClass('DashedRoute');\r\n\r\nRouter::scope('/', function ($routes) {\r\n    $routes->connect(\"/test\", [\"controller\" => \"Projects\", \"action\" => \"index\"]);\r\n    $routes->connect(\"/test/:action/*\", [\"controller\" => \"Projects\"]);\r\n\r\n    $routes->fallbacks();\r\n});\r\n\r\nPlugin::routes();\r\n```\r\n\r\nI can't find anywhere in the documentation that this is required. According to http://book.cakephp.org/3.0/en/development/routing.html#fallbacks-method all the fallbacks method does is add some default routes."},"comment":{"url":"https://api.github.com/repos/cakephp/cakephp/issues/comments/160845703","html_url":"https://github.com/cakephp/cakephp/issues/7764#issuecomment-160845703","issue_url":"https://api.github.com/repos/cakephp/cakephp/issues/7764","id":160845703,"user":{"login":"ADmad","id":142658,"avatar_url":"https://avatars.githubusercontent.com/u/142658?v=3","gravatar_id":"","url":"https://api.github.com/users/ADmad","html_url":"https://github.com/ADmad","followers_url":"https://api.github.com/users/ADmad/followers","following_url":"https://api.github.com/users/ADmad/following{/other_user}","gists_url":"https://api.github.com/users/ADmad/gists{/gist_id}","starred_url":"https://api.github.com/users/ADmad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ADmad/subscriptions","organizations_url":"https://api.github.com/users/ADmad/orgs","repos_url":"https://api.github.com/users/ADmad/repos","events_url":"https://api.github.com/users/ADmad/events{/privacy}","received_events_url":"https://api.github.com/users/ADmad/received_events","type":"User","site_admin":false},"created_at":"2015-12-01T04:05:20Z","updated_at":"2015-12-01T04:05:20Z","body":"> It reports that it can't find a route for controller \"Requirements\" (another controller in my project)\r\n\r\nThat's your problem. The stack trace on the error page shows that in your `Projects/index.ctp` template you have a url for `['controller' => 'Requirements', 'action' => 'index']`  and since you haven't set an explicit route for it you need the fallback routes for the router to be able to generate URL for it."}}