From the book: book.cakephp.org/3.0/en/development/routing.html#route-elements (just below the code you may have cut-and-pasted):
CakePHP does not automatically produce lowercased and dashed URLs when using the :controller parameter. If you need this, the above example could be rewritten like so:
$routes->connect(
'/:controller/:id',
['action' => 'view'],
['id' => '[0-9]+', 'routeClass' => 'DashedRoute']
);
...and then a little further down:
Once this route has been defined, requesting /apples/5 would call the view() method of the ApplesController. Inside the view() method, you would need to access the passed ID at $this->request->params['id'].
So in my (for example) ApplesController's view() method, I added the following at the very top:
if ($id == null) {
$id = $this->request->params['id'];
}
...and now apples/view/5 and apples/5 both work the same way.