Welcome Guest, Not a member yet? Register   Sign In
Myth/Auth - Routing problem
#5

No that’s not the URL these routes will point to because you are using a group.
The group function is there to not having to repeat the same things for all route.

PHP Code:
//Restricted to logged in users
$routes->group('user', ['filter' => 'role:Users'], function($routes) {
    $routes->get('user''User::index'); // Does NOT work
    $routes->get('profile''User::profile');  //Works Correctly
}); 

...is the same as:

PHP Code:
$routes->get('user/user''User::index', ['filter' => 'role:Users']); // Does NOT work
$routes->get('user/profile''User::profile', ['filter' => 'role:Users']);  //Works Correctly
}) 
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/
Reply


Messages In This Thread
Myth/Auth - Routing problem - by BilltheCat - 04-12-2020, 04:23 PM
RE: Myth/Auth - Routing problem - by includebeer - 04-12-2020, 06:17 PM
RE: Myth/Auth - Routing problem - by BilltheCat - 04-12-2020, 08:23 PM
RE: Myth/Auth - Routing problem - by BilltheCat - 04-13-2020, 04:25 AM
RE: Myth/Auth - Routing problem - by includebeer - 04-13-2020, 04:26 AM
RE: Myth/Auth - Routing problem - by BilltheCat - 04-13-2020, 04:46 AM
RE: Myth/Auth - Routing problem - by Nome - 04-13-2020, 06:16 AM
RE: Myth/Auth - Routing problem - by includebeer - 04-13-2020, 06:39 AM
RE: Myth/Auth - Routing problem - by Nome - 04-13-2020, 06:51 AM
RE: Myth/Auth - Routing problem - by includebeer - 04-13-2020, 07:08 AM
RE: Myth/Auth - Routing problem - by Nome - 04-13-2020, 07:19 AM



Theme © iAndrew 2016 - Forum software by © MyBB