After struggling to fix the class not found issue when extended controller class with core class, I have found a suitable solution on how to autoload the core classes so that we can use it with our controller classes.
Go to Config.php inside the config folder and paste this code at the bottom
function __autoload($class)
{
if(strpos($class, 'CI_') !== 0)
{
@include_once( APPPATH . 'core/'. $class . '.php' );
}
}
Go to Config.php inside the config folder and paste this code at the bottom
function __autoload($class)
{
if(strpos($class, 'CI_') !== 0)
{
@include_once( APPPATH . 'core/'. $class . '.php' );
}
}
Comments
Post a Comment