My routing.php contains such string:
$routes->connect(’/product_detail/’, [‘controller’ => ‘pages’, ‘action’ => ‘productDetail’]);
But I am getting such message: Error: A route matching “product_detail” could not be found.
I see debug info and in the list of connected routes I see:
/product_detail [ ‘controller’ = ‘pages’, ‘action’ = ‘productDetail’, ‘plugin’ = null ] [ ‘_ext’ = [], ‘routeClass’ = ‘Cake\Routing\Route\DashedRoute’ ]
It was working fine and this error appeared only when I upgraded my CakePHP from 3.3 to 3.6.
Try to remove the trailing slash. What does happen?
Like this: $routes->connect(’/product_detail’, [‘controller’ => ‘pages’, ‘action’ => ‘productDetail’]);