Tuesday, May 13, 2008

Looking for a PHP Framework

MVC is an import design pattern for web development. I think the easiest way to apply MVC with PHP is to use an appropriate framework. So I have been looking for an appropriate PHP framework for quick development these days. The diffficult thing is that there are too many choices. It seems that the most widely used are Zend Framework, Symphony and CakePHP. I think CakePHP is better because it is lightweight. Symphony has lots of documents, especially it supports AJAX well, but it is said it's hard to learn. Zend Framework is too fat so I doubt if it is convenient to learn and to use.

Also, I found PRADO PHP Framework. It is component-based and event-driven. Event-driven seems interesting. The code style is similar to JSP and ASP.NET.

Which framework do think is best? Maybe I shouldn't waste much time to choose a framework. But unlike JSP, Struts, Hibernate and Spring is enough for almost any web application, frameworks in the world of PHP are too many. That's hard to choose one to start to learn.

Any suggestions?


Wil said...

I'm not exactly unbiased, so I won't even weigh in on which one is better. :)
I'm curious why you think ZF is 'fat', however. Do you mean that it takes up more space on the disk? This is something that we don't really try to optimize (although we will have a lean and mean distro- hopefully soon). Most people have plenty of disk space, and you can always take out the components you don't want if you in a constrained environment, such as on a hosting provider.
I'd argue that ZF is the most lightweight of the frameworks you mention, because ZF is exactly how big you want it to be depending on what you use. With many other frameworks you usually have to consume their entire stack from views to data store. Not that they don't have their advantages, but if I were concerned with the 'weight' of a framework I'd be looking at the average memory consumed per request and not the package size.
My apologies if the package size was not what you meant, it's just that's usually the case when people characterize Zend Framework as 'heavyweight'.


Wang Jinbo said...

Thank you, wil. In fact I think it doesn't matter that how much disk space a framework takes up. Since I haven't used a PHP framework before, I feel that the bigger the framework is, the harder it is to learn. I want to know how to employ a framework, besides, I want to know the principle or the architecture. So I think ZF is 'fat' and more difficult to learn than others (like CakePHP).
Now I'm studying CakePHP. Of course I will go to see Zend Framework as it is used very widely.

Thanks again.