CodeIgniter Forums
Dynamic changing of default_controller - 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: Dynamic changing of default_controller (/showthread.php?tid=30674)



Dynamic changing of default_controller - El Forum - 05-22-2010

[eluser]vishok[/eluser]
Is possibile changing default_controller getting it froma database?


Dynamic changing of default_controller - El Forum - 05-22-2010

[eluser]WanWizard[/eluser]
Not without a lot of tricks, because the routing decision happens long before you have access to the database.

For my project I don't use routing at all, I have a fixed route to my 'bootstrap' controller, which does the dynamic routing based on database info.
Some others have an admin application to manage the dynamic paths, and generate a new config/routes.php when an update is made. This is probably an easier route.