1

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.

Rai Vu
  • 1,595
  • 1
  • 20
  • 30

0 Answers0