![]() |
Place several elements in the router - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: Model-View-Controller (https://forum.codeigniter.com/forumdisplay.php?fid=10) +--- Thread: Place several elements in the router (/showthread.php?tid=399) |
Place several elements in the router - SquallX - 11-29-2014 Hi eveybody It's my first post on the forum and it's why i well present myself. Firstly, I'm French, so please excuse my grammar and my language mystakes ![]() I ha a little question about the routing in codeigniter. I am creating a forum and i want to pass all my parameters in the URL just like that : http://base.com/forum/category-name/forum-name/topic-name And I would for :
And I would to do it automatically with the router. But this code doesn't run : PHP Code: $route['forum'] = 'forum/index'; with theses functions in the Forum Controller : PHP Code: /** I don't know if my method is right or if I have an error with my code but I would learn the best practice to do that ![]() Thank you very much ![]() RE: Place several elements in the router - includebeer - 11-29-2014 Would be simpler with a url like /forum/cat/category-name/forum-name/topic-name function cat ($category = "all", $forum = "all", $topic = "all") http://www.codeigniter.com/user_guide/general/controllers.html#passinguri RE: Place several elements in the router - SquallX - 11-30-2014 Exactly yes ![]() |