08-10-2019, 12:58 AM
(This post was last modified: 08-10-2019, 12:59 AM by tgix.
Edit Reason: typo
)
Struggling along trying to recreate my REST API from CI3 in CI4-beta4. I find it very cumbersome to configure all my route entries in Routes.php like this (far from complete):
Is there a way to have the routes live in the Controller instead or am I overthinking this?
PHP Code:
$routes->group('users', function ($routes) {
$routes->get('list', 'Users::list');
$routes->get('(:num)', 'Users::get_user/$i');
$routes->options('(:any)', 'Users::options_respond');
});