[eluser]Enshteyn[/eluser]
Hello!
I have a file MX_Controller with three classes.
Base -> parent::Controller()
Frontend -> parent::Base()
Backend -> parent::Base()
There is a module "auth" with library "Auth_lib". I need to load the library "Auth_lib" in the constructor of class "Base"
I did so:
Code:
public function Base() {
parent::Controller();
$this->_autoload_mods();
}
// --------------------------------------------------------------------
/**
* Автозагрузка библиотек модулей
*
* @access private
* @return void
**/
private function _autoload_mods() {
$list = array(
'auth' => 'Auth_lib'
);
foreach ($list as $key => $value) {
$this->load->library($key . '/' . $value);
}
}
But with this method of classes "Frontend" and "Backend" mix, but this should not be.
How you can implement a global autoload library module?