Welcome Guest, Not a member yet? Register   Sign In
[solved] need help to write routes
#1
Exclamation 
(This post was last modified: 07-27-2016, 01:27 AM by jaynarayan.)

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'
          Heart  love codeigniter Heart
          Learning  best  practices
     Rate my post if you found it helpfull
Reply
#2

(This post was last modified: 07-27-2016, 01:26 AM by jaynarayan.)

solution:

PHP Code:
$route['admin/users(.*)'] = 'users/admin$1'
          Heart  love codeigniter Heart
          Learning  best  practices
     Rate my post if you found it helpfull
Reply




Theme © iAndrew 2016 - Forum software by © MyBB