Recently I’ve started to work on a idea that I wanted to bring it alive as web 2 application. I decided to use PHP as my development language, since PHP has already been there for a long time and has a well supportive community. But when I started looking for a PHP framework to start with, I was confused to choose one, since there are many. After doing some more research and advice from friends (Thejesh, Vinay), I narrowed down my list to Zend, CakePHP, CodeIgniter and Symfony.
After doing some more googling and blog reading, it looks like Zend and CakePHP are the top PHP frameworks amongst the developer community. So I further reduced my list and now only there are two frameworks to choose from : Zend or CakePHP.
My basic requirements are:
-
Less configuration
-
Ajax support
-
Friendly URLs
-
More structured/Maintenable code
Considering those requirements, which framework will you suggest!?
{ 2 trackbacks }
{ 26 comments }
Though it didn’t make your shortlist you should check-out the upcoming Recess Framework for PHP: http://www.recessframework.org/
Regarding friendly URLs and less configuration the screencast on Routing may be interesting for you: http://www.recessframework.org/page/routing-in-recess-screencast
The public preview of the framework was released late December so it is early stage- but has some interesting design differences (like a focus on REST) from the older frameworks.
Rating Cake wrt you req
A. Less configuration
3/5 it needs configuration
B. Ajax support
3/5 has decent AJAX support. Point is you can use any other AJAX js framework along with it.
C.Friendly URLs
5/5 easy
D.More structured/Maintenance
4/5 well structured. 3/5 I had problems while moving from one version to next version
Zend and CakePHP are top but CodeIgniter is hot now.
Both three (CakePHP, Code Igniter and Symphony) are pretty good and will help you get the job done. I personally use CakePHP and recommend it for the ease of use and features.
I would use Zend. It a modular/component based as compared to the other frameworks which are usually full stack frameworks and require you to use everything. With Zend you could use just the view component of the db component for that matter. Cake is good but it still supports php4 which is not good in my view because php5 is full oo and using php5 has many advantages. Zend is php5 only.
CakePHP is our main competitor. We want all the CakePHP users to move forward and start using Zend.
I think you shouldn’t disregard Symphony so easily. It maybe not one of the most popular frameworks on the block, it’s a well though out framework.
One of the newer frameworks is Yii seems to be very promising.
I think the ajax requirement is a non requirement for a server side framework. You should be able to choose your own way of adding client side functionality. If ajax support is build in it it by definition limited.
Using a framework has as main disadvantages the bad performance and the learning curve (you are learning framework code, not php). The creator of PHP (Rasmus Lerdorf) suggests to build in raw php if you plan to build something big with traffic. However he showed that codeigniter is by far the fastest framework (you can also check other benchmarks), so I might suggest codeigniter which is also easy to learn.
Why not use CakePHP as the base framework and throw the Zend framework on top?
I’ve been using PHP for years and recently decided to use a “framework” to help with the mundane tasks involved with starting a new project as well as keeping my files organized and using more OO code.
I setup test installs for each of the ones you mentioned and found that codeigniter was the overall winner. (Zend being the most complex).
I’ve been using it now for about a month on a little side project of mine and the more I use it, the more I like it.
Pros: Good community, good documentation, easy install/deployment, high flexibility (MVC) and small footprint (file and memory size).
Cons: Most addons are not fully mature. (authentication for example. Althought DX_Auth is the best so far.) Wish their was a codeigniter “cookbook” for the current version.
P.S. I do not work for codeigniter or EllisLabs, I just like their stuff
Forgot to mention. I successfully integrated Smarty and the Zend library into codeigniter so now I can use smarty tags in the view files (as well as regular php) and have access to all the zend library functionality.
Yii seems to a decent framework, with nice documentation and fast growing community. One big advantage is that it integrates well with ZF.
Thank you all for all your valuable suggestions!
It depends on several things.
If you need it to be modular, use Zend. It’s more a collection of useful libraries than a real framework.
If you need it to be fast, use CodeIgniter. It’s a bit less complex than the others, and this makes it a bit faster.
If you need something powerful and very well written, pick symfony. It’s very well documented, requires PHP 5 (5 for 1.0, 5.1 for 1.1 and 5.2 for 1.2) and IMHO it’s the best PHP framework out there.
If you need ajax, don’t use Cake. It has the worst progressive enhancement of the mentioned frameworks (maybe CI is worst, but I honestly don’t remember). You can use an eternal library and manage it by yourself, but using this options every framework acts the same..
If you can use PHP 5, use symfony. Ok, it has more config files than the others, but believe me, you won’t need 5/6 of them. Plus it has tons of plugins, and if you need to use a DB as I suppose, you can choose between Propel and Doctrine, two realy good ORMs.
CI doesn’t have an orm, so you have to write the queries by yourself. Cake has something inspired by ActiveRecord, but I actually don’t trust it. Zend doesn’t have a real ORM, but (as always) a collection of useful classes.
If you want to use a framework with VERY long class names, just for fun, pick Zend…:D
By the way, you should try, even a bit, every one of them. I love symfony, but you might prefer cake, or CI, or Zend. It’s just a matter of taste in the end, they’re all good projects..
Have a look to symfony. The best PHP framewok imho
I think that your selection based on Google Trends are little wrong, because Zend is not only PHP framework. Because of that the trend was way up. My results are different – http://www.google.com/trends?q=zend+framework%2C+cakephp%2C+symfony%2C+codeigniter&ctab=0&geo=all&date=all&sort=0
I have used Symfony for two big projects. One was portal and the other web application. With Zend Framework I have done one e-shop and couple of custom webpages.
If you use Symfony you get the whole application with one cli command. Symfony is unit and functional test ready and is continuous developable out of the box. Symfony has cache and escaping mechanisms already inside. With Zend you have to implement all those things yourself, at least gather the components.
My few problems with Symfony are concerned with Symfony’s database ORM-s. In Symfony 1.0 it used Propel, which used Creole, and the whole thing was slow. Latest problem was with Propel Criteria, which with MySQL joined tables in the wrong order and it took half a day how to do it right.
With Zend Framework like I said you have to invent couple of wheels that Symfony already has. But while you do that you learn Zend Framework and in the end it seems to you that you know Zend Framework. On the contrary you don’t have to know Symfony very well to use it. So, while inventing Zend Framework you learn and can customize more than you could in Symfony.
I haven’t used CakePHP, but in my opinion to be compatible with PHP4 is not a good thing anymore.
I really think you should give Symfony 1.2 another look.
Code Ignighter is nice if you need to a framework for PHP 4, but for big projects Symfony is significantly better.
While I have not worked with Cake, much more than looking at the documentation, the people I work with don’t have good things to say about it.
Zend does have some great plugins, but it’s initial setup and high level of freedom are good for large one off projects. However, that freedom to set things up like you want comes back to haunt you when you have a high volume team environment.
Symfony has a strict structure that makes every project’s directory structure and code seem a familiar from project to project. This is similar to the idea of writing self-documenting code. Even with this strict directory structure and coding standards I’ve never felt limited by symfony.
A downside of Symfony and any large framework is that there is a big learning curve. The upside is that lessons learned from one app translate easily to every other app you do.
This is why I think that Symfony has a distinct advantage in a high volume team based environment, or anytime someone else may be maintaining the app at a later time.
+1 for Symfony 1.2, it is excellent.
Try once to look at the source code of these frameworks. Once I checked CakePHP and I was not impressed what I found. Zend or symfony’s code has much higher qualify, are based on common design patterns, and are written from scratch for PHP5.
Yii seems cool. It needs a few more things like testing (to be finished in 1.1) but even right know, it looks nice. Its code is also of good quality. Personally Zend and Symfony’s code are of great quality, of course, and I also find Yii’s source very well organized.
We can talk about these frameworks for ages, the thing is: no one framework will suit everyone. That’s why everyone seems ‘inventing’ their own nowadays with php. That’s why I like the ruby world. You have rails (and merb – but these two are now merging as rails v3) and that’s probably it. There are others – for sure – but none of them have much following compared to rails.
//no one framework will suit everyone//
Agree on that. But getting an opinion from the PHP developers about the framework they use will certainly help others to choose their framework.
Hi probably you should take a look at DooPHP. It is easy to use and it is fastest PHP framework as we have did some benchmark comparison at http://doophp.com/benchmark (you could benchmark by yourself too). DooPHP provide fastest performance to ensure web app would not get any delay due to the framework performance. Also we provide core features that other framework does. Do try to have a look xD
The trend mentioned earlier, is actually skewed due to framework only mentioned with one brand.
Try these, and Zend seems to come out on top all the time.
http://www.google.com/trends?q=zend+framework%2C+cakephp+framework%2C+symfony+framework%2C+codeigniter+framework&ctab=0&geo=all&date=all&sort=1
http://www.google.com/trends?q=zend%2C+cakephp%2C+symfony%2C+codeigniter&ctab=0&geo=all&date=all&sort=1
I too am in search of the best option, for rapid development, and thought the trend search you hit on is a great idea and might lend an insight to best options. I also like the fact that it generates some recent product news on the time-line.
thanks all.
I am new in MVC like you. I’m looking what is the best for me. This post is very useful for me.
Thank you guys.
Zend and CakePHP are top but CodeIgniter is hot now.
Yii framework is the best choice
Comments on this entry are closed.