I am making website, that will be used by 2 different user types. And both types have different controllers. But some things are common for both users, specifically I want to make a class that will contain methods that will be run when either user logs in (it will check some stuff like is email confirmed etc etc..)
Anyway, I tried to create new library, and that worked sort of.. But there are problems because $this is not available, and I need to use $CI, which needs to be redeclared on every method.. so it is a bit of a pain.
Any better way to do it?
Extend the Controller class. Have a look here:
Codeigniter MY_Controller