Welcome Guest, Not a member yet? Register   Sign In
How to get default_controller value
#1

[eluser]LifeSteala[/eluser]
Hi,
Is there a way to get the default_controller value in a controller? I tried,

Code:
config_item('default_controller');

but that didn't work.

Thanks
LS
#2

[eluser]TheFuzzy0ne[/eluser]
Code:
include(APPPATH . "config/routes.php");
echo $route['default_controller'];

should do it. I'm sure there's an easier way, but I'll be darned if I can find it!
#3

[eluser]LifeSteala[/eluser]
Cool, that works! Thanks!
#4

[eluser]TheFuzzy0ne[/eluser]
Ah-ha! There is a better way!
Code:
$this->router->default_controller; // Contains the default controller name.

Hope this helps.
#5

[eluser]LifeSteala[/eluser]
Oh Cool! Well done! Thanks once again.




Theme © iAndrew 2016 - Forum software by © MyBB