如何最好地选择 PHP 框架 - Laravel、Symfony、Zend 等

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22675277/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 16:10:43  来源:igfitidea点击:

How to best select a PHP framework - Laravel, Symfony, Zend, Etc

phpsymfonyzend-frameworklaravel-4zend-framework2

提问by user3408844

My company wants to adopt a PHP framework and I am being asked to decide which one to use going forward.

我的公司想要采用一个 PHP 框架,我被要求决定使用哪个框架。

Our requirements are simple

我们的要求很简单

  1. It must be part of the php-fig
  2. Must look like it will be around & active for at least another 10 years
  3. Must have a healthy community
  4. Must have libraries/bundles/modules/packages/etc or whatever they are called that we can draw on to speed up development.
  1. 它必须是 php-fig 的一部分
  2. 必须看起来它至少还会存在并活跃 10 年
  3. 必须有一个健康的社区
  4. 必须有库/捆绑包/模块/包/等或任何我们可以利用的名称来加速开发。

Using the above criteria I have found frameworks that I like

使用上述标准,我找到了我喜欢的框架

  • Symfony -> Seems to be an industry leader / feels a little over engineered
  • Laravel -> very popular at the moment and easy to use/understand
  • Zend -> Zend 1 hurt my feelings and I have never really forgiven it, I am just not comfortable with Zend
  • Symfony -> 似乎是行业领导者/感觉有点过度设计
  • Laravel -> 目前非常流行且易于使用/理解
  • Zend -> Zend 1 伤害了我的感情,我从来没有真正原谅过它,我只是对 Zend 不舒服

I would like to use Laravel but point 2 above concerns me as its really driven by one person, even though there is s strong community, that one person still has too strong an influence its not like Drupal where if Dries goes away the community will not crumble, I feel that if Tyler goes then Laravel will fall. And as much as I like it I don't want to tie my company to that wagon.

我想使用 Laravel,但上面的第 2 点让我担心,因为它确实是由一个人驱动的,即使有强大的社区,但一个人的影响力仍然太大,不像 Drupal,如果 Dries 离开,社区将不会崩溃,我觉得如果泰勒走了,那么 Laravel 就会倒下。尽管我很喜欢它,但我不想将我的公司与那辆马车捆绑在一起。

This question is NOT about which framework is better BUT how to best decide on selecting a framework for your Company

这个问题不是关于哪个框架更好,而是关于如何最好地决定为您的公司选择一个框架

回答by Tim Fountain

We can't tell you what is the best framework for you- only you can decide that. But you've mostly answered your question in your description of your options - it seems like Laravel is what you're leaning towards. Plus, it's an open source project, if the creator were to throw in the towel I'm sure there would be enough momentum for others to pick it up.

我们无法告诉您什么是最适合您的框架- 只有您可以决定。但是您在对选项的描述中主要回答了您的问题 - 似乎 Laravel 是您所倾向于的。另外,这是一个开源项目,如果创建者认输,我相信会有足够的动力让其他人接受它。

One additional point I'd make: 10 years is a long time in web development - none of the frameworks in your list existed 10 years ago. It's good to try and choose something with some longevity, but I wouldn't try and plan too far ahead.

我要补充的一点是:10 年是 Web 开发的很长一段时间 - 您列表中的框架在 10 年前都不存在。尝试选择一些长寿的东西很好,但我不会尝试提前计划太远。

回答by Brian Anderson

Tons of articles have answered this question already. One written a little over a year ago should give you a decent idea of how to make your decistion:

很多文章已经回答了这个问题。一年多以前写的一篇文章应该可以让您对如何做出决定有一个不错的想法:

http://jonathanmh.com/best-php-mvc-frameworks-of-2013/

http://jonathanmh.com/best-php-mvc-frameworks-of-2013/