• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.