Tag Archives: Eloquent

Revisiting MY_Model in CodeIgniter: Copying from Jamie Rumbelow and looking at Eloquent

Created at: February 11, 2015; Last update: March 2, 2015
This tutorial turned into a Github repository.
Please give it a try at:
https://github.com/avenirer/CodeIgniter-MY_Model

This tutorial is a work in progress created at 2015.02.11 and updated at 2015.02.17. It’s tested with CodeIgniter 3.

Well… It’s that time when we should stop repeating ourselves. The DRY philosophy tells us that maybe we should use our time doing things faster than repeating the same steps for basic CRUD in our models. I’ve talked about the MY_Model subject in the past, but we can improve a lot on that.

A few years ago, Jamie Rumbelow wrote a great book named CodeIgniter Handbook in three volumes, in which he manages to bring Ruby philosophy in the world of CodeIgniter. In the book he talks about Convention over Configuration, trying to apply design principles like Don’t Repeat Yourself (DRY) and RESTful style to CodeIgniter. Continue reading