How to retrieve routes['default_controller'] |
[eluser]stormbytes[/eluser]
I'm trying to grab the default controller via one of my libs. Tried the obvious ($CI->uri->router->routes['default_controller']) with no luck. Anyone got a suggestion?
[eluser]InsiteFX[/eluser]
Code: $this->CI->config->item('default_controller'); InsiteFX
[eluser]stormbytes[/eluser]
Come on... no way.. Couldn't be that easy. I'm omitting the $this as I'm accessing $CI through a library. Returns FALSE.
[eluser]wiredesignz[/eluser]
The Router has a $default_controller class variable. Beware that this may become a protected value in the future. It may be more appropriate to extend the CI_Router class and add your own get_default_controller() method. @InsiteFX, default_controller has never been stored in the CI config items?
[eluser]stormbytes[/eluser]
[quote author="wiredesignz" date="1303025079"]Extend the CI_Router class and add your own get_default_controller() method.[/quote] Now there's a sound idea!
|
Welcome Guest, Not a member yet? Register Sign In |