CodeIgniter vs. CakePHP

Posted Apr 21, 2009. Filed under PHP.

Disclaimer: this is not a full-fledged comparison on either of the frameworks, rather, my impression of them after a short evaluation period and which one I chose.

It was about 9 months ago when I was talking with a friend over a beer about programming that I found out there was a much easier way to do things. Up until that point I had been doing all of my web development using SQLite and PHP without any type of framework. My typical PHP script looked like this:

include 'header.php';
if($_GET['view'] == 'someview'){
    //database query(s)
    //display html and php data
include 'footer.php';
Everything worked fine and I had no complaints, but if you cant see over the fence you don't know that the grass is greener! He mentioned MySQL instead of SQLite, and CakePHP to ease and organize development. Sometime after that conversation I looked into CakePHP, read through the docs (cookbook) and downloaded and installed it. I had several existing sites that I was planning on moving into the MVC framework so setting up a new database to Cake's liking was not an option. This was one of the downfalls of CakePHP for me. It seemed as if to take advantage of many functions the database tables had to be named a certain way, along with the controllers, models, views etc ... slightly overkill for what my needs were. And even after playing around with it for a while, I was still unable to get everything set up and working to my liking. So, despite my love of baked goods, it looked like CakePHP was not for me.

I went on my way, coding the way I used to (but now using MySQL) and it wasn't until some of my scripts were pushing the 100KB / 2000 line mark that I realized this isn't working and isn't right. I took another stab (fork?) at CakePHP, still unable to get it running the way I wanted and needed. It was shortly after that I read something about CodeIgniter and decided to give it a shot. Downloaded, installed it and read through the docs and was able to get it up and running fairly quickly. The documentation was clear and simple, and file/database/class naming conventions seemed to be less strict than that of Cake's. I was able to easily write queries in the model to grab data out of my existing database, regardless of the table names. Everything seemed simpler and easier with CodeIgniter.

So after using both frameworks I decided to go with CodeIgniter and it's currently running this site! While CakePHP's robustness and strict(er) conventions may be a positive to some, it was not for me. All in all, both frameworks were qualified however CakePHP seemed overqualified and slightly over complicated.

Filed under PHP. Tags: cakephp, codeigniter, comparison, mysql, php, software
Posted Apr 21, 2009 by Dan | 3 comments
Like this post? Share it:                  


December 8, 2009 at 11:22pm

Do you remember that time we walked Denny's after Joe M dumped fish food in your tank and almost killed your fish? I asked you that night after dinner if you were using MVC and you hadn't heard of it, yet. We cut our tech convo short out of fairness to heg n' dave, though.

December 11, 2009 at 10:17am

Yeah, that was a great time. I've learned a lot since then!

March 23, 2010 at 3:16pm

Thanks for this post, you've helped me decide to use CodeIgniter. I've just been introduced to MVC frameworks and couldn't decide between Cake and CI. After experimenting with both I came to the same conclusion as you but still couldn't decide which was best for me.

Leave A Comment

name *
email *

comment *

Preview Comment
Submit Comment!

GUIDELINES: I reserve the right to delete off-topic, inflammatory, or anonymous comments. Get your own picture next to your comment with a Gravatar account.