![]() |
URI Routing - 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: URI Routing (/showthread.php?tid=22140) |
URI Routing - El Forum - 08-30-2009 [eluser]m40[/eluser] I'd like to use URLs like www.example.com/item/123/ where 123 is the item ID. I can think of 2 approaches: 1) having a controller named item and a function inside of it for each item; this, of course, is an awful approach; 2) using routing - something like $route['item/(: num)'] = "items/view/$1";; I was wondering if a more elegant approach is available. Thanks! URI Routing - El Forum - 08-30-2009 [eluser]MARKNEUBURGER[/eluser] I had a similar problem and went with your second idea. |