Do I need to add a URI reroute for every single function for every single class? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Do I need to add a URI reroute for every single function for every single class? (/showthread.php?tid=54249) |
Do I need to add a URI reroute for every single function for every single class? - El Forum - 08-30-2012 [eluser]iamsen47[/eluser] Just wondering. Because if so, it seems like this is going to be a real chore when building a huge website. This is my current routes. Code: $route['tickets/index/(:any)'] = 'tickets/index/$1'; Do I need to add a URI reroute for every single function for every single class? - El Forum - 08-30-2012 [eluser]Migranux[/eluser] Hello, No, you don't Code: $route['tickets/index/(:any)'] = 'tickets/index/$1'; Do I need to add a URI reroute for every single function for every single class? - El Forum - 08-30-2012 [eluser]CroNiX[/eluser] routing Quote:Important: The reserved routes must come before any wildcard or regular expression routes. Do I need to add a URI reroute for every single function for every single class? - El Forum - 08-30-2012 [eluser]iamsen47[/eluser] [quote author="Migranux" date="1346355044"]Hello, No, you don't Code: $route['tickets/index/(:any)'] = 'tickets/index/$1'; Thanks. Doesn't that mean that the create and login pages will have to be placed in the view functionality? === I tried replacing my routes with the ones you provided and my links stopped working. I have only one controller called tickets.php with the index, create and login functions all inside it. Could I be doing something wrong? Do I need to add a URI reroute for every single function for every single class? - El Forum - 08-30-2012 [eluser]iamsen47[/eluser] [quote author="CroNiX" date="1346356390"]routing Quote:Important: The reserved routes must come before any wildcard or regular expression routes.[/quote] Thanks, I have read that but it's just a bunch of jargon to me... Do I need to add a URI reroute for every single function for every single class? - El Forum - 08-30-2012 [eluser]iamsen47[/eluser] Code: class Tickets Essentially this is what I have in my tickets.php controller with the earlier routing I posted up top. After switching to Migranux's routing, none of the links work anymore. Have I misunderstood something somewhere? baseurl/class/function/otherstuff therefore baseurl/tickets/index baseurl/tickets/create baseurl/tickets/login Am I correct? My config.php's base_url is just 'http://localhost/cidir/' and index_page is left blank. Could these be the reason why the links stopped working? |