Welcome Guest, Not a member yet? Register   Sign In
Changing Routes in Existing Application
#1

[eluser]johnnyletrois[/eluser]
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:

Code:
$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:

Code:
$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:

Code:
$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?

Thanks.




Theme © iAndrew 2016 - Forum software by © MyBB