I want to create route to run contoller and action separated by hyphen(-) instead of calling controller/action. I tried below code :
Router::scope(
'/add-user',
['controller' => 'Users'],
function(RouteBuilder $routes){
$routes->connect('', ['controller' => 'Users', 'action' => 'add']);
$routes->fallbacks(DashedRoute::class);
}
);
But using this I will have to create a route for each controller and action. I want something which can work for all. Thanks.