Welcome Guest, Not a member yet? Register   Sign In
Bug in routes with path in controller
#13

(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.  Big Grin

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 ?
Reply


Messages In This Thread
Bug in routes with path in controller - by acy29 - 11-22-2019, 05:44 AM
RE: Bug in routes with path in controller - by paulkd - 05-14-2021, 02:14 AM



Theme © iAndrew 2016 - Forum software by © MyBB