![]() |
Retrieving the default controller config item - 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: Retrieving the default controller config item (/showthread.php?tid=2812) |
Retrieving the default controller config item - El Forum - 08-25-2007 [eluser]NemetraL[/eluser] Hello, The problem is: I'd need to retrieve Code: $route['default_controller']; There's the raw way, which consists in copying the Router library code directly inside the hook: Code: // Load the routes.php file. But once the controller is loaded, I can't find it anymore :-S Any idea? Retrieving the default controller config item - El Forum - 08-25-2007 [eluser]NemetraL[/eluser] Gosh I posted that too fast.. A simple: Code: $ci =& get_instance(); Code: var_dump($ci); PS: it's incredibly useful to var_dump() the main controller from time to time to remember all the things it carries with it along the code execution ;-). Retrieving the default controller config item - El Forum - 08-26-2007 [eluser]John_Betong[/eluser] Hi NemetraL, Have you tried? Code: echo "<br /><pre>"; or Code: echo "<br /><pre>"; Retrieving the default controller config item - El Forum - 08-27-2007 [eluser]NemetraL[/eluser] Yes the problem is solved now. I had to go through the var_dump(), which default layout is less readable than the print_r() by the way ;-). Retrieving the default controller config item - El Forum - 04-15-2011 [eluser]stormbytes[/eluser] I wonder if there's a way to do this using CI 2.02 ? I tried your method and it returns an error. |