[eluser]Unknown[/eluser]
I tried the library approach, but it can only be accessed through composition but not inheritance.
Specifically, I first created a script:
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Someclass {
function some_function()
{
}
}
?>
Then put it into the library folder, and modified the autoload.php to auto-load it.
After that I can access it in other controllers through composition like:
$this->someclass->some_function();
But still I cannot sub-class it like:
class SubClass extends Someclass {
// some logic here
}