• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Changing Routes in Existing Application

OK so I'm sure this is a dumb question with an easy answer, but I have looked around and experimented and am still having difficulty. I have an existing application that I am adapting. The original routes.php looks like:

$route['default_controller']    = "home";
$route['search']                     = "search/index";
$route['rooms/(:num)']           = "rooms/index/$1";
$route['rooms/new']               = "rooms/newlist";

I've replaced line 4 with:

$route['shop/new']             = "rooms/newlist";

and then changed links throughout the application to 'shop/new' to reflect the routes change. Fortunately, there weren't many links to change.

My current problem is I want to change line 3 to:

$route['shop/(:num)']          = "rooms/index/$1";

but there are a whole ton of links throughout the application that would need to be changed. Is changing all those links the only solution? Are the links in views the only ones that need to be changed? Is there an easier way to do this than changing 150ish links like through mod_rewrite in .htaccess?


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.