CodeIgniter Forums
[solved] need help to write routes - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: External Resources (https://forum.codeigniter.com/forum-7.html)
+--- Forum: Addins (https://forum.codeigniter.com/forum-13.html)
+--- Thread: [solved] need help to write routes (/thread-65806.html)



[solved] need help to write routes - jaynarayan - 07-26-2016

hi, i am using ci3 with wiredsign's hmvc.

i have the users modules with two controllers 1) public_user 2)admin_user

these are theĀ  routes


PHP Code:
$route['admin/users'] = 'users/admin';

$route['admin/users/create_action'] = 'users/admin/create_action';
$route['admin/users/create'] = 'users/admin/create';

$route['admin/users/update_action'] = 'users/admin/update_action';
$route['admin/users/update/(:num)'] = 'users/admin/update/$1';

$route['admin/users/delete/(:num)'] = 'users/admin/delete/$1';

$route['admin/users/show/(:num)'] = 'users/admin/show/$1'




is there any way to achieve this without writing routes for each URL individually ?

i tried this but not working

PHP Code:
$route['([a-zA-Z_-\/]+)admin/users([a-zA-Z_-\/]+)'] = '$1users/admin$2'



RE: need help to write routes - jaynarayan - 07-27-2016

solution:

PHP Code:
$route['admin/users(.*)'] = 'users/admin$1'