Which one to go; Yii or Symfony

前端 未结 3 2056
北荒
北荒 2021-02-04 21:05

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

相关标签:
3条回答
  • 2021-02-04 21:19

    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

    0 讨论(0)
  • 2021-02-04 21:27

    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:

    • The PHP Framework Interop Group is a consortium of contributors representing frameworks and they created some standards, namely the three layers known as PSR-0, PSR-1 and PSR-2
    • PHP The Right Way is a collaborative work on what is the current best practices.
    • Tobias Schlitt's definition of a framework

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

    0 讨论(0)
  • 2021-02-04 21:30

    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 :)

    0 讨论(0)
提交回复
热议问题