(05-14-2021, 01:35 AM)InsiteFX Wrote: You can use the namespace in a group route but all the routes under it should belong to that namespace.
Hi InsiteFX,
Thanks very much for your help.
If I'm interpreting the group options correctly it looks like I can specify a group "namespace" but not a group "controller" under a group namespace.
So what I have at present is
Code:
$frontNameSpace = ['namespace' => 'App\Controllers\Front'];
$routes->get('/', 'Main::index', $frontNameSpace);
$routes->get('about', 'Main::about', $frontNameSpace);
$routes->get('products/(children|men|women)', 'Main::getProducts/$1', $frontNameSpace);
$routes->get('bag', 'Main::bag', $frontNameSpace);
$routes->get('checkout', 'Main::checkout/card', $frontNameSpace);
Do you think there's a better way to group these routes ?