CodeIgniter Forums
** solved ** dynamic routing from database - 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: ** solved ** dynamic routing from database (/showthread.php?tid=24716)

Pages: 1 2


** solved ** dynamic routing from database - El Forum - 11-17-2009

[eluser]Tottys Design[/eluser]
[quote author="Colin Williams" date="1258510941"]Advanced routing usually involves overloading the core Router class (creating a MY_Router library). If you take a look at the Router class, it should be pretty clear where you'll want to make your modifications.[/quote]

I can't load models in the Router class because they are loaded only after the controller. I've tried all day to do that and I can't. If someone here can help me, I really appreciate so much your help!


** solved ** dynamic routing from database - El Forum - 11-17-2009

[eluser]Colin Williams[/eluser]
You can load up the DB class manually, but beware you will end up with two connections, adding a bit of overhead to performance.

Code:
require_once BASEPATH.'database/DB'.EXT;
$db = DB();



** solved ** dynamic routing from database - El Forum - 11-17-2009

[eluser]Tottys Design[/eluser]
[quote author="Colin Williams" date="1258519901"]You can load up the DB class manually, but beware you will end up with two connections, adding a bit of overhead to performance.

Code:
require_once BASEPATH.'database/DB'.EXT;
$db = DB();
[/quote]

Thanks so much! Now I'm working on... Thanks!!!


** solved ** dynamic routing from database - El Forum - 11-18-2009

[eluser]Michel-Ange[/eluser]
Quote:So you are saying this:
MY_Controller extends Controller
Core_controller extends My_Controller
and when a request comes, Core_controller loads it and then, how can I load the other controllers the I would need, “gallery”..?

Yes...

(How should I say to you not to polute a thread with a topic wich has nothing to do with ?)