[eluser]Dewos[/eluser]
[quote author="Too Pixel" date="1224257264"]For a better flexibility of your library, I personally like the solution of Jon. You should add it as an option and still coders can also use your way.[/quote]
1 - Automatic get Routes Default Controller Name from
Routes.php
(only) your homepage a bit slower but automagic:
Code:
if ( empty($segment) )
{
@include(APPPATH.'config/routes'.EXT);
$segment = $route['default_controller'];
unset($route);
}
OR
2 - Config Mode (A bit faster but config manual):
Code:
$this->ci->config->item('default_controller');
Choose your destiny and let me know what you prefer for next release