[eluser]cPage[/eluser]
Is it ok to put this code in config.php ?
Code:
function __autoload($classname)
{
if( strpos($classname, 'CI_') !== 0 )
{
$file = APPPATH . 'libraries/' . $classname . '.php';
if(file_exists($file) && is_file($file))
{
@include_once($file);
}
}
}
I saw this little hack in a tutorial about managing Frontend_controller and Backend_controller.
Quote:CI_Controller
-MY_Controller (core/)
-Frontend_Controller (libraries/)
-Backend_Controller (libraries/)
credit to : Tuts+
I tried to skip the function of the config file by adding those 2 controllers to the autoload array without success, and then i understood that MY_ is the only way, that i can implent my own libraires, or this code in config.php.
It would be nice if CI add something else than
MY_ other options like Frontend or Backend .
Is there something more appropriate for Frontend and Backend supports?