PHP Frameworks Comparision

I recently spent some time to do some research on different php frameworks. I know there are a lot of PHP MVC (Model View Controller) frameworks out there. But I tried checking only three of them – CodeIgniter, CakePHP and Zend framework. All these frameworks are Open Source. I’m not going to give you a detailed review of each and every point of each framework, as you can find lot of detailed reviews out there. This is just a conclusion on review of those.

CodeIgniter

CodeIgniter is really a framework with very small footprint, as they claim it. It has all the MVC structure, scaffolding and all. Even though I don’t think scaffolding can be used for production purpose in it. CodeIgniter is basically a structure and some libraries and easy to learn compared to the other two frameworks I think. If you are about to start a project straight away and you want to use an MVC framework, then CodeIgniter is best option as the learning curve is small. And its also flexible, not strict on the MVC rules, as you have the option not to use models in the MVC structure and code around different ways you like to achieve the result you want.

CakePHP

CakePHP is also a very robust framework. I think we can define it as CakePHP is to PHP is more like what Rails is for Ruby (Correct me if I am wrong, as I’m not too much familiar with rails). The problem with CakePHP is the learning curve is more than that of CodeIgniter, and most importantly you need to code exactly how they want you to code. i.e. you have to follow exact naming conventions, even follow it in database field naming too. Even a missed underscore or a different name (than what they expect) for an object can pop up as an error. For example, if the model object name is “User” then the Controller object name for it has to be UsersController, exactly the same model object name in plural form. And this is a must and CakePHP will show errors if they don’t find the object. But the good part of that is if follow the conventions correct in CakePHP, everything falls in correct automatically. In addition to this the scaffolding feature of CakePHP is also brilliant.

Zend Framework

I really didn’t got a chance to try too much in it, mainly because the learning curve far more bigger than the other two frameworks. Zend has a massive objects library (yeah I mean really BIG library). You can understand it by just by seeing the download file size of Zend framework, its around 12 MB whereas other frameworks mentioned above are only around 1.5 MB. Zend framework is not very strict in their conventions and coding compared to CakePHP I think. I would say its just a massive library in the MVC structure that can be used it whichever way we want it to be used for projects. But I’m still not familiar with Zend compared to the other two frameworks, so I may be wrong about. (Feel free shed some light on my review if you know more about Zend framework).

Conclusion: To me I would pick CodeIgniter or CakePHP. I really can’t pick between these two. CakePHP needs some getting used to also, but I think it will help to standardize the coding as every coder has to follow same rules.

Feel free to post your comments about your experience with these frameworks.

Prabhul Sankar
www.southoceansolutions.com