It’s an old debate, running for ages and still debate on air! But While i worked on different projects with these frameworks, i felt few lacking of both frameworks, at the same time impressed with xcellent features. I’ve made a list here –
Auth, ACL Component/Library
CakePHP has very strong Auth component with Core.
In CodeIgniter – you have to create or find a suitable plugin for you, although CodeIgniter has many classes which are rarely used(such as ftp class) i wonder why it’s not there. It’s vary important for the most of the applications.
CakePHP’s Bake console can create any of CakePHP’s basic ingredients: models, views and controllers, can create a fully functional application in just a few minutes.
Very badly, Codeigniter doesn’t has code generation from console, you’ve to find out a plugin.
CakePHP comes with ORM(Object Relational Mapping is a programming technique for converting data between incompatible type systems in databases and object-oriented programming languages) while in CodeIgniter, you have to depend on third parties.
CodeIgniter’s Scaffolding feature provides a fast and very convenient way to add, edit, or delete information in your database during development which is deprecated from version 1.6.0.
CakePHP scaffolding is a technique that allows a developer to define and create a basic application that can create, retrieve, update and delete objects. Scaffolding in CakePHP also allows developers to define how objects are related to each other, and to create and break those links.
CakePHP comes with Ajax helper which can be used in various ways. i didn’t see this with CodeIgniter core.
Both runs on PHP4 and PHP5 but both doesn’t take any facility of PHP5 while runs on PHP5 Machine. CakePHP declared, their upcoming version 2.0 will runs only on PHP 5.2 which definitely take advantage of PHP5’s OOP and ohter killer features.
I believe CodeIgniter is simple and working with this, it’s so easy while in CakePHP coding process is quicker for expert but its hard to find out what’s going on For Newbie.
Both of them are MVC supported framework but in Codeigniter you can build your project without Model which may lead messy and unsecured code sometimes(if anybody place direct query without any filtering). Codeigniter Model supports Method Chaining(PHP5 only) feature that’s fantastic. Most important is Model association, which absent in Codeigniter! In CakePHP, query are very simple to get value from a table by any field with related data.
Cakephp came with console features. You can generate code or upgrade db schema from your console. If you are working with a team remotely and you don’t allow other user to handle your db directly – you can use this feature.
CodeIgniter doesn’t has this feature.
In Codeigniter, validation is handled by a validation class. The validation class can also help automate some of the process of setting error messages for specific fields.
In CakePHP, validation rules are defined in Model, can be validate data before save or at saving. I like CakePHP validation, it’s fantastic.
CakePHP handles this fairly well by using a default layout, easy to implement header , footer, sidebar while CodeIgniter takes a very straightforward approach – something like buiding a application from scratch. CodeIgniter allows caching mechanism for your view which is pretty good.
I love CodeIgniter’s file uploading class by which it’s very easy to handle uploading files. CakePHP doesn’t has this.
Codeigniter has many classes such as ftp, compression, cart etc etc classes. You may need certain classes for your project which already in CodeIgniter and not with CakePHP but you may find out component most of the time.
Both has web services in built in. CakePHP has REST while CodeIgniter has XML-RPC but both doesn’t has SOAP, you need to find out component/plugin.
Auto Calling Functions/Other Functions
In CakePHP, there are few functions which are automatically called every time you refresh/hit a page and executed if you defined them such as beforeSave, afterSave, beforeRender etc – I just love these. I found a function called requestAction in cakephp that calls a controller’s action from any location and returns data from the action, sometimes its very useful.
I found CakePHP helpers(such as form helper, it highlight input field for validation error automatically) are powerful than CodeIgniter.
The learning curve of CakePHP is slightly higher than CodeIgniter. As CakePHP is a shade of ruby on rails, so its easy to get rails or cakephp developer to get them accordingly.
CakePHP has solid support, you will get your answer very shortly while in CodeIgniter, i am still waiting for a answer in CodeIgniter forum, strange!
Both are well-documented so far.
CodeIgniter comes with many classes, less of them are frequently used but missed important classes such as auth, straight forward but no automagic feature, MVC but not strict. I missed these features while i was working on a project using CodeIgniter. You may or may not face few problems while learning CakePHP but once you learnt, I believe – you’ll like it for its automagic, strict convention, faster development and for many more wonderful features.
Notes – This comparison was based on the documentation for CodeIgniter 1.7.2 and having used CakePHP 1.2.