Welcome Guest, Not a member yet? Register   Sign In
Frontend and Backend (Base controllers)
#1

[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?




Messages In This Thread
Frontend and Backend (Base controllers) - by El Forum - 01-20-2013, 08:47 PM
Frontend and Backend (Base controllers) - by El Forum - 01-20-2013, 08:50 PM
Frontend and Backend (Base controllers) - by El Forum - 01-20-2013, 10:55 PM
Frontend and Backend (Base controllers) - by El Forum - 01-21-2013, 07:37 AM
Frontend and Backend (Base controllers) - by El Forum - 01-21-2013, 07:57 AM
Frontend and Backend (Base controllers) - by El Forum - 01-21-2013, 08:10 AM
Frontend and Backend (Base controllers) - by El Forum - 01-21-2013, 04:58 PM
Frontend and Backend (Base controllers) - by El Forum - 01-21-2013, 06:00 PM
Frontend and Backend (Base controllers) - by El Forum - 01-21-2013, 08:36 PM
Frontend and Backend (Base controllers) - by El Forum - 01-21-2013, 10:49 PM
Frontend and Backend (Base controllers) - by El Forum - 01-22-2013, 12:21 AM
Frontend and Backend (Base controllers) - by El Forum - 01-22-2013, 12:45 AM
Frontend and Backend (Base controllers) - by El Forum - 01-22-2013, 12:58 AM
Frontend and Backend (Base controllers) - by El Forum - 01-23-2013, 07:27 PM
Frontend and Backend (Base controllers) - by El Forum - 01-23-2013, 09:22 PM



Theme © iAndrew 2016 - Forum software by © MyBB