CodeIgniter Forums
Should codeigniter have a group routes like laravel - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forum-28.html)
+--- Forum: CodeIgniter 4 Feature Requests (https://forum.codeigniter.com/forum-29.html)
+--- Thread: Should codeigniter have a group routes like laravel (/thread-65928.html)



Should codeigniter have a group routes like laravel - Aris Haryanto - 08-11-2016

hey

shoud codeigniter have a group routes like laravel
anyone here built this i want to contribute


RE: Should codeigniter have a group routes like laravel - kilishan - 08-11-2016

It does have it


RE: Should codeigniter have a group routes like laravel - AmarInfotech - 08-13-2016

Yes it have, You can see example here.

Routes can be grouped together under a common prefix, reducing the amount of typing needed and helping to organize the routes.

$routes->group('admin', function($routes) {
$routes->add('users', 'Admin\Users::index');
$routes->add('blog', 'Admin\Blog::index');
});

These routes would be available under an 'admin' segment in the URI, such as:


test.com/admin/users
test.com/admin/blog