CodeIgniter Forums
Help with controllers, not routing correctly - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Help with controllers, not routing correctly (/showthread.php?tid=31459)



Help with controllers, not routing correctly - El Forum - 06-20-2010

[eluser]ChaosKnight[/eluser]
Hi, I'm working on a tourism website, so there are lots of hotels, guest houses, etc. So I wanted to make a unique controller for each type. I created a controller, guest-houses.php, and named the class Guest-House. For some reason the router doesn't route it to that controller, is there some way to use a '-' in the class and route name and let it work properly?

This is my current route that I tried to use for that page:
Code:
$route['guest-houses/(:any)'] = "guest-houses/display/$1";

But it doesn't route to the guest-houses.php controller as I wanted it to.

Any ideas?


Help with controllers, not routing correctly - El Forum - 06-20-2010

[eluser]ChaosKnight[/eluser]
Sorry, after reading my own post I felt like an idiot... I just renamed the controller to guest_houses.php and the class to Guest_Houses and in the routes I changed the route to:
$route['guest-houses/(:any)'] = "guest_houses/display/$1";