Archive
February 2010
CodeIgniter Base Classes: Keeping it DRY
Most applications in CodeIgniter will have various types of pages. Logic for these types of pages is normally copied between all of their different Controllers which means, for example, if the way the admin area protection is handled is changed there will be lots of Controllers to change and test. This logic can instead be shared by some creative extending of the Controller class to create custom Base Controllers like Public_Controller, Admin_Controller, etc.
