The main thing i want to solve is to check user session when somebody want to access admin panel. I\'ve created MY_Controller class and placed it in library.
cla
I got this error on a project as I'm learning CodeIgniter. My solution was to, to use your project as an example, require_once('MY_Controller');
at the top my new Controller.
That way I didn't have to move my file to the core and I could keep it in my directory of Controllers.
CI_Controller
class instead of CI_Session
MY_Controller
under application/core/
folder instead of application/library
Codeigniter introduced a new folder called core
where the libraries that doesn't require loading lives. The original CI_Controller class is one of them, so if you want the automagick pick up your MY_Controller.php
file you should place it under application/core
too.
When in doubt, check the extended class's original version under system
directory and mirror that under application
.
(Also in your first code example, i think you meant to extend CI_Controller
not CI_Session
)