Subdirectory Controller Problem - 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: Subdirectory Controller Problem (/showthread.php?tid=13218) |
Subdirectory Controller Problem - El Forum - 11-14-2008 [eluser]Kyle Wiebers[/eluser] I'm building my first website with CodeIgniter and it's very easy so far. However I want to create a url like localhost/MU/events/rooms/roomname, where roomname changes with the room the user selects. I have a function rooms in the events controller that takes an argument, but when trying to access the main page, localhost/MU/events/rooms CI throws an error that I was missing an argument. My code looks like this: Code: function rooms($room) Is there anyway to eliminate the error on the page? Subdirectory Controller Problem - El Forum - 11-15-2008 [eluser]julgus[/eluser] Hi instead of using isset I would prefer $this->uri->segment(n) where n is the number of the uri segment. This contains the value if it exists of false if nothing is specified. You have to load the uri class. Regards Subdirectory Controller Problem - El Forum - 11-15-2008 [eluser]Rick Jolly[/eluser] Code: function rooms($room = false) { Subdirectory Controller Problem - El Forum - 11-15-2008 [eluser]Kyle Wiebers[/eluser] Thanks for the help. I love the CodeIgniter base, it is by far the easiest and best supported framework I've ever used. |