As loyal readers to my blog know, my employer has committed to using CodeIgniter for projects, although I hold out hope that new projects with my beloved CakePHP. That’s okay, I’m a big boy and can handle working with different things as clients (and bosses) demand. So, after maybe a week and a bit of working with CodeIgniter I thought I’d talk about it.
Once you know one MVC framework, you know them all. My experience with CakePHP and Zend Framework means that understanding how CodeIgniter works in the context of MVC is simple.
CodeIgniter mixes OOP and functions. CakePHP has a much, much stronger commitment to using objects to access core functionality. A quick example is this is the way both frameworks handle forms in the views.
$data = $this->defaultdata();
$lookupResults = $this->Leagues->getLeagues();
$data['lookupResults'] = $lookupResults;
$data['mainview'] = 'league_browse';
Lack of conventions makes Chris sad. I am very used to CakePHP’s habit of just knowing where things are supposed to be instead of me having to specify everything. Yes, I understand that CodeIgniter is all about doing it your way, but I’ve grown to like the CakePHP way. I like that my actions in the controller know where to find the view…as long as I’ve followed the conventions.
CodeIgniter’s User Guide Is Awesome. Logical groupings, cool Web 2.0 features when you click on the table of contents. Yes, we finally have some documentation for CakePHP 1.2 available but it is ‘alpha with extreme prejudice’ in it’s current form. I’m not saying CakePHP should copy what CodeIgniter is done. I’m sure there will be an awesome final place for the CakePHP 1.2 documentation. But for someone starting out with CodeIgniter, the user guide is an essential tool.
No built-in associative data mapping makes Chris sad. But then again, I’m not really having to deal with much in the way of databases on this current project due to us using eXist.
So, there you have it. A very, very early look at my thoughts on CakePHP vs. CodeIgniter. I’ll post the more interesting things I come across along the way as my current project gets built out more…