Posted by Fred Wu
Update: There is now a more recent comparison of CodeIgniter 1.7.1, Kohana 2.3.1 and Yii 1.0.3.
When I was reading through my subscribed feeds I came across this post: Notes on Choosing a PHP Framework: A Comparison of CakePHP and the Zend Framework by Chad Kieffer.
Chad has done a great job comparing the two frameworks that he’s interested in. That inspired me to write something up for the frameworks that I prefer and use. :)
I began hunting for PHP frameworks ever since Ruby on Rails hit the street. Coincidentally one of the first PHP frameworks I played with was CakePHP. At that time CakePHP’s documentation was nearly non-existent so I had to seek for an alternative. I did a lot of searches, and researches, and finally I was happy to see CodeIgniter. Its user guide was what impressed me the most, I am sure many of the fellow CI users would agree with me on this one. Because of the excellent documentation, I was able to start working on projects right after I spent a few hours on the user guide! Developing apps on CI was such a breeze! Today, I develop web applications in CodeIgniter, Kohana and Zend Framework. If you want to find out how to use Zend Framework components with CI or Kohana, please read my previous blog entry: Using Zend Framework with CodeIgniter.
Nice review Fred :) I hadn’t seen Kohana before. I’ll take a look.
I think you made a good point here, there is no need to choose only one framework when we could use it both.
Nice article.
Kahona is very interesting indeed. I have had frustrations with Code Igniter. Especially the rendering of the $data['var'] to the view file and the $_POST and $_GET.
as quoted from their homepage:
GET, POST, COOKIE, and SESSION arrays all work as expected. Kohana does not limit your access to global data, but offers filtering and XSS protection.
- this is exactly what frustrated me in CI. (http://blog.ekini.net/2008/02/.....hy-zf-ftw/)
Seems that everything that I dont like in CI is fixed in Kohana. I have added to my bookmarks and will go back to check it out – definitely. ;-)
Thumbs up, Kohana sounds interesting, I’ll check it out. PHP devs need more articles like this to make informed decisions without spending their whole lives trying to get the info needed. Where is your subscribe button? Ah found it :)
Nice article. I just read the docs on Kohana and found them to be very good to excellent. Maybe your review was before the current docs were published. Also, I’m wondering what, besides your familiarity with CI and Kohana, keeps you from just using Zend Framework for all larger projects. It seems to have the most comprehensive API and still has the MVC framework that you find in CI and K. Is Zend not “light weight” causing it to suffer some noticeable performance issues? I’m new to PHP but experienced in .Net and Java with various frameworks including Maverick, Spring, and Webwork so I want to adopt best practices with a proven PHP framework. Thanks!
The way I see it is: they are all fantastic frameworks. To me, because ZF doesn’t force you to a specific design pattern (you don’t even have to use MVC), it allows great flexibility but at the same time it requires the developer to build the system structure. Kohana and CI both have a great foundation structure you can rely on, so that saves more time and effort for us developers. Plus, in my opinion Kohana and CI are simpler than ZF, so they’re easier to pick up. ZF on the other hand offers more independent libraries for varies functionalities.
Just my 2cents. :)
Can I suggest looking at one more framework, the Andromeda Database Framework.
It take the framework to the next level and allows for the business rules to be put in the database rather than in the “interface”. It has direct integration into SVN, allowing for releases to be pushes from development to production using development standards.
Andromeda takes a unique approach and defines the database using YAML, as well as the business rules/calculations get placed in the YAML files as well.
I would highly recommend taking a look. You can find Andromeda at http://www.andromeda-projects.org/
Good review… I hope you keep it updated :)
Thanks Chris, I certainly will. :)
@Donald: Thanks for the link! Andromeda looks very interesting although it is (sort of) in a different field to Kohana and Zend Framework. Correct me if I’m wrong but Andromeda is a lot more oriented to database driven websites. It generates the database and the entire backend from definition files. I am not sure what impact does it have on portability and extendibility. In Rails they have migration to keep track of database changes, is there an equivalent in Andromeda?
I can answer your questions to Donald re: migrations. These are not necessary in Andromeda. All you have to do is update the text file that describes the database and Andromeda’s upgrade manager figures out the differences and takes care of it.
Comparisons to Ruby will be more confusing than anything else, as they are so different its like comparing fish to bicycles. Ruby is all about managing development tasks, while Andromeda is about eliminating tasks and simplification.
Also, as far as I know, only the smallest static sites have no database on the back end. Andromeda makes this a cornerstone but that is only the beginning.
Thanks for the comparison.
I’m at the beginning stage of a project I want to build, and have had a tough time deciding which framework to use. I’ve so far dabbled with CakePHP and Symfony, both of which I found quite difficult to get started with.
And Kohana has a unit_test module since a little while now. Yay!
Yeah I actually played around with it a couple of days ago, although I’m not sure if I’ll use it instead of PHPUnit/SimpleTest.
Excellent reveiw, would be grateful, if you were to update this periodically as both seem to be undergoing a lot of development.
I would also like to know how different the syntax is between the two, from what I understand kohana, is moving towards its own style.
Thanks, this was a great article and spawned a good discussion on php frameworks. I was looking for this exact info.
I have dabbled with CI a little, but I have bought in to the whole php5 oop thing, so I was looking for something that could leverage php5 without worrying about having to support php4.
I was leaning towards ZendF until I found Kohana. I think I might learn some basics with CI and then run with Kohana. Thanks again!
@Grant: Syntax-wise CI and Kohana are very similar, albeit Kohana just deprecated the support for ‘$this->load’ in favour of standard PHP object assignment: ‘$var = new Class_name’. There are some other differences too but once you get to know both, you’d find that they’re very similar in most cases.
@Grant and JNettik: Thanks I am glad you guys liked it. I will try to keep this article up to date. :)
What about the performance?which one is better?Thanks a lot!
Zozowang: Check out my other post: http://thislab.com/2008/03/25/.....benchmark/
there’s a built in template class for ci since beta 1.0
Template Parser Class
Thanks’ for the review fred. I got your article several days ago to decide whether i wanted to try kohana or not. And i decided Yes :D
I’ve been just exploring kohana 2.2 today with help of user guide from http://docs.kohanaphp.com/. I think kohana is very impressive (except ORM as i haven’t read that part yet :D). Mostly like CI so the learning curve could be so fast.
Regarding to speed benchmark (#28) well the gap is not so big with CI.
I’m wondering if there’s kohana community in Indonesia.
KohanaPHP is like CodeIgniter with ORM. http://www.lorztech.com
great post, i would be very grateful if you put the background of your blog to some brighter color. black is very beautiful, i agree, but at the end i see strange shapes on the screen. :)
Very interesting comparison. I am analysing which framework to use for a project that’s just about to start, but disliked the fact that CI enforces compatibility with PHP4. First time I’ve read about Kohana and I am keen to give it a try! Let’s hope their Unit Testing module is available by now. Cheers!
Hi,
What are the differences of CI 1.7 and K 2.3?
i choose CI than Kohana simply just because it had a much better documentation. If Kohana documentation is as good as CI, then i would switch to Kohana immediately