Which one to go; Yii or Symfony

2020-05-24 09:12发布

Okay. I'm NOT asking which one is better. I know Yii is not better than Symfony, Symfony is not better then Yii.

I'm asking which one should i go with it.

I want to give some points:

I have a large project which is very-well formatted and very-well coded. If you seen my codes you would think that i made my own framework but its not. It just that very-well coded. I'm using custom made Controllers for HTTP requests.

All i want to do is make my code much more easier to use and much more easier to understand and easier to edit. Component by component editing and extending.

I'm also using Zend Framework as a component but not framework base.

So, as you developers, which project framework for base coding do i really go with it. Yii or Symfony?

I actually loved Yii but Symfony's Bundle systemn and Namespaces are attract me. But i really wonder which one should i go.

As i said, im not asking which one is better. I want to get your throughts regarding to this issue.

I'm open for suggestions. Give me a path.

标签: symfony1 yii
3条回答
时光不老,我们不散
2楼-- · 2020-05-24 09:39

I think what you search is to see what is the recommendations more than any Evangelism.

Just to give some pointers about what is the current state of PHP, and nice components that is using the latest php features.

Requirements

Make sure what you use has, a way to...:

  • send to the log (Monolog is a good one)
  • parse text only config (YAML is a good one)
  • logic-less templating, with some convention (Mustach, Twig)
  • dependencies definition manifests (Composer is the way to go, very similar to package.json that Node offers)
  • define common "service" instantiation mechanism (DependencyInjection is one example)
  • abstracted way to load libraries (ClassLoader component is a good one)
  • Localization management (see Symfony2/Twig documentation )
  • abstract database calls without hardcoding database vendor specific (Doctrine2, Propel)
  • Unit testing structure, usage and conventions (PHP Unit, Behat, Mink)
  • Database code doesn't use "mysql" and istead uses mysqli

And all of that distinct functionality packages that you can mix and match.

Mix and match

There is some efforts underway that address this exact issue, here some interresting ones:

Hope this helps you. with your own choice of which framework to invest on.

查看更多
狗以群分
3楼-- · 2020-05-24 09:39

Since you already use Zend, why not using it as a framework ??

And there is no anwser to your question, it depends on project needs...

Symfony should be use on 'big' projects with fast servers.

Yii is still a 'light' framework, but is very fast compared to Symfony, and has a short learning curve...

...etc

查看更多
放荡不羁爱自由
4楼-- · 2020-05-24 09:56

Yii is probably the truest 'framework' of all the options - it provides the scaffolding you need with almost no assumptions about how you would prefer to implement anything (except perhaps the inclusion of jQuery). It is incredibly fast to develop with, and very very fast to execute which translates to excellent scalability.

Projects I have used Yii for have always ended up well ahead of schedule - Yii just seems to make sense in the way it works. My experience with Symfony is limited, I will admit, but compared to Zend Yii is a breeze. The Gii MVC generator is a fantastic head start too, generating models and basic CRUD code from your database tables.

ALl this is just my opinion from my own experience, but that is what you asked for :)

查看更多
登录 后发表回答