-
Notifications
You must be signed in to change notification settings - Fork 0
ActiveRecord Class
This page details an implementation of Active Record for CodeIgniter that more accurately mimics the way Ruby on Rails works with models. It allows you to abstract large amounts of the searching and creation code out of your models, and can help with streamlining your controller code as well.
[b]NOTE! Due to some of the code this technique uses, it will only work if you are running PHP5![/b]
[h3]Implementation[/h3]
To begin using the ActiveRecord class, download the most recent version and save it into your [b]/application/libraries[/b] folder. This file replaces the CodeIgniter Model class, and all your models will inherit from it.
Next, edit [b]/application/config/autoload.php[/b] and make sure that both the ActiveRecord and database libraries are automatically loaded when CodeIgniter runs:
[code] $autoload['libraries'] = array('activerecord', 'database'); [/code]
PAGE UNDER CONSTRUCTION
- Original author: Derek Jones
- How to extend helpers: See User Guide
- Modified by: Thomas Stapleton (id, classes, selected country option and all option)
- Modified by: Bradley De-Lar (construct, setLayout example)