Welcome Guest, Not a member yet? Register   Sign In
help with setting up routes rules
#1

Hi,

I am having trouble in setting up the routing rules. In the app/Config/Routes.php, all HTTP verb use would result with 404, but get. Here's how I am setting up the rules which is in trouble.

PHP Code:
$routes->group('admin', ['namespace' => 'App\Controllers\Admin'], function ($routes) {
    
$routes->add('/''User::index');
    
    
$routes->group('page', ['namespace' => 'App\Controllers\Admin'], function ($routes) {
        
$routes->add('/''Page::index');
    });
}); 

But this works.

PHP Code:
$routes->group('admin', ['namespace' => 'App\Controllers\Admin'], function ($routes) {
    
$routes->get('/''User::index');
    
    
$routes->group('page', ['namespace' => 'App\Controllers\Admin'], function ($routes) {
        
$routes->get('/''Page::index');
    });
}); 

Thank you for your time in advance.

Wing
Reply


Messages In This Thread
help with setting up routes rules - by wing - 06-28-2020, 08:02 PM



Theme © iAndrew 2016 - Forum software by © MyBB