Parent Class Your Code Igniter Controllers
Code Igniter offers many ways of adding functionality to your application… Libraries, Helpers, Plugins… However, there are times when you need a function to operate directly in your controller. In these cases it can be useful to create a parent class for your controllers.
One case where this makes sense is when you want all your controllers to respond to a particular message in the same way. For example you have a login form on every page and you want the user to stay on the same page once they login successfully. With a parent class you can have the login method in the parent and then send the user back to the page they were just on or just to the index.
(more…)