views:

5501

answers:

10

Which PHP framework should I choose between ZendFramework or YII?
Points I need to consider:

  • Performance (assuming an accelerator is used)
  • Documentation
  • stability of framework
  • less to code.
+11  A: 

As I, myself, ventured into a similar question lately I'll share my thoughts with you.

Yii is relatively new in contrast with other frameworks, so it poses a risk regarding availability in know how and longer production runs with it. It also lacks features.

Zend framework is backed by Zend itself, lots of companies are using it in a day to day basis, lots of great documentation and rich feature set. There are two pitfalls though as I've seen from my experiments. One, there is no special way in how you'd do the thing in the "right way" - it is pretty much flexible to your ways. I see that as a plus rather than a minus. Second, as with other frameworks you give up performance to MVC layout - it looks like, in case with Zend, more so than with some other frameworks. During my tests it didn't show up as much as I'd thought it would and I am prepared to accept that performance level - even though I have a project that is somewhat heavily loaded with user hits.

Another option I would suggest you to pursue is CodeIgniter. It resembles Zend Framework, but is more lean and performance less hungry. I chose Zend because of a more complete feature set, official backing by Zend and the fact that I liked it when I made tests with it.

However, I would suggest you make a demo with all of three frameworks and see for youself which one you like most. It doesn't have to be a large demo, but try to grasp some of the features you will make in production (authentication, database manipulation etc.) and implement it in different frameworks - answer will come out by itself. Just try it yourself, do yourself a favour - I was looking for an answer all over, but in the end these tests were the one that provided me with one.

Keyframe
I know it is a difficult task to pick one. I've picked one that proved me with demo I wrote that I may like to work with it and Zend offered me comfort in that it won't go dead and even a prospect of support if I needed it someday.
Keyframe
+1  A: 

It's hard to answer your question based on those four categories. You should really choose a framework based on your project/personal goals not your development ideals. Everyone wants their code to run fast, have great documentation and be stable with minimal lines of code.

  • The Yii website shows it has great performance though I don't believe their graph. Zend has good performance when using standard PHP optimization techniques.
  • Zend has good documentation, there are tones of examples for it online and lots of forum post about how to solve problems with it. Yii also has pretty good documentation with user feedback. The Yii community is still pretty small however and there are only a few tutorials for it online and very few forum post.
  • Zend has good stability. Yii is still new so it's hard to predict it's stability.
  • Zend can be very verbose. Yii will give you a smaller code base.

Zend is something you choose if you are going to do many projects with it. If you only need a framework for a project or two then choose something else. I would not choose Yii simply because it is new. Using new software always increases the risk of project failure.

To answer your question I would say Yii assuming this is for a personal project and going off of your profile. You will find it much more exciting to work with than Zend.

gradbot
+3  A: 

I know it's not on the list, but I have you had a look at Kohana (http://www.kohanaphp.com)? Kohana is my personal framework of choice for a couple reasons.

  1. It's simplistic
  2. It has a low learning curve
  3. Good performance
  4. Easy to integrate things from other frameworks (i.e. Zend ACLs)
  5. It has a great community with almost always someone on irc that will help you
William
+1 for suggesting something else, and that something being Kohana :)
alex
+2  A: 

I know that Yii is created by the main guy behind Prado and I never liked Prado myself. It is very intelligently designed but I just didn't click with its templating system. Seemed like a case of "smart guys develop smart system that people don't want to use".

That said I am currently evaluating Yii because it does look impressive and is boasts pretty high performance (and it has abandoned the Prado way of templating... well, it has it as an optional feature).

gaoshan88
So you actually using Yii now, Is there a way to contact you in a few weeks and ask you about it?
Itay Moav
Sure. My profile has a link to my site where you can reach me through the contact page. I'm still going through the basic blog tutorial but I will try some customizing of that blog in order to see how painful it is to do common things like access control, form validation, etc.
gaoshan88
+4  A: 

Zend FrameWork is really slow ... Yii is really fast

Zend FrameWork must run on PHP 5.2.X( You can't use Zend_Date or Zend_Locale on 5.1 ) Yii must run on PHP 5.1.X

Zend_Mail has many bug .... shit . and never fix it (v0.1~v1.7) !!

Why so many developer design ZF , but give us slow and bug framework ...

The end solution was to use ZF MVC framework only (which I really like) and use custom libraries for the rest...
Itay Moav
A: 

For Performance I use DooPHP, just found out this framework recently. And I use Zend framework components with it since they share the same new BSD license. DooPHP + Zend = Performance + rich list of features

Besides the framework is really easy to get started than Yii or CodeIgniter. IMHO the database ORM in Doophp is very good.

+6  A: 

Here is my experience with both.

Performance : Yii wins Documentation : Zend Wins stability of framework : Draw less to code. : Yiiiiiiiiiiiiiiii (ZF is too much espaguetti)

You can achieve the same result with both, but, with Yii it's easier, quick, SIMPLE. And, can it be use some modules from Zend framework, not the entire framework.

Ismael
A: 

zend = windows yii = mac

the author of yii knows what user-friendlyness is. that is a VERY important aspect.

yes, zend got a huge codebase, but just have a look at their online api documentation...than you take a look at yii:s..and that is the difference you should be concerned about.

a userfriendly way will always win over time

weng
Yes, you should be concerned with the fact that Yii's documentation is mostly API docs, while Zend actually has detailed, complete documentation.
ryeguy
+2  A: 

I do prefer Yii over all other PHP frameworks.

Yii

  • has a very good documentation.

  • is super fast.

  • gives you great power with strong code controlling.

  • is not only fast in performance, it is also fast in framework release. Yii core team are releasing very often with a lot of new features.

  • community is growing rapidly.

  • is 100% true OOP framework.

Firas
+1  A: 

Everyone has their own prefer framework but if you choose less code, high performance then I tend to Yii.

Some mentioned that Yii is young but I donot agree as the fact that Yii is the rebuilt of Prado which is even OLDER than Zend consider the time framework is mature enough to use in production environment. Prado has been used 4-5 year ago but its event-driven architecture plus its XML based heavy configuration mechanism make it slow. Yii is rewritten to fix those kind of issues.

Zend is huge as its big name. I think practical minds choose Yii as so many people still using CodeIgniter. The reason is simpler as better and because Zend is a bunch of dependent components it will become slow in moving forward, adding new things as dependency is high.

Personally, I choose a framework for speed and short learning curve. Check out the framework architecture to make sure there is not too much dependency among components and layers are well structured. Don't care additional features such as a a lib to zip/unzip, create feed or connect to Yahoo/Googe API. In this open source world, when you really need those things, you can always found the best for your need as people keep porting good lib from one framework to another all the time.

If you need a sandbox for your project startup, consider FlexicaCMS which is a Yii based CMS. It's pretty fast and has some exceptional editing/customizing features that even Joomla, Drupal or Wordpess don't have.

Pokamy