Selling Yii2 To Your Boss

I want to start a discussion about the strong points that would convince your boss to use Yii2 as the framework of choice when developing a new version of your application. I think the main competitor now is Symfony2, so maybe a comparison between the two would help. Please keep reasoning arguments.

Sorry for being negative, but if you don’t already have strong arguments maybe you shouldn’t force any particular solution? Always use the best tools for the job and most often the best tools are the ones you know best and can handle them well.

Maybe you should restate your question? That is, which features of Yii 2 stand out?

No problem, any feedback is wellcome. I’m trying to start a discussion. I have worked with Yii1 and started some work with Symfony2. I follow the Yii2 development and it looks promising. Some stand out features I see:

  • Active record, especially the possibility do use with so many different database vendors.

  • It seems that Yii2 performs better.

  • Simpler code.

  • Nice extension integration with composer.

But Symfony2 has some strong enterprise appealing:

  • Bigger user base, more developers available to hire.

  • Stricter code structure, so the application code doesn’t change a lot from developer to developer.

  • Better support?

What else do you think are the cons/pros from each one?

[s]Actually, new AR is good only for simple cases. When you need something bigger, AR cannot handle it.

Here’s an example: you need a paginated list of data from two tables joined together (ex-with), so that you can sort and filter these records by some conditions. Pretty common task, eh?

Still this is very painful in Yii2 (you’ll need either to make two requests, or use some sophisticated logic like defining second model’s fields inside first model)

I have had a lot of "wont fx" issues with Yii2 and currently thinking of downgrading to v1 or switching to some other FW.[/s]

UPD: see conversation below.

I had a similar impression as ORey, but we need to remember that Yii 2 is still in alfa. The focus has been on providing a clean base not only for SQL databases. The missing relations features can be added to the existing implementation and I will be looking into it soon.

Still, Yii 2 codebase seems cleaner and I’d definetly would enjoy using namespaces and composer. I’m going to rewrite my toolbox to extend it, possibly in a form that can be shared with the community. It’s the best moment to propose the best ideas to be included in the core.

Unfortunately, I can’t compare it to any other popular framework.

Very difficult or unfair to compare an alpha version of a FW in development versus a production version of a FW. Really its up to a development team’s preferences on where you have tools/resources to do it better and fast. Theoretically Yii 2.0 promises much more feature updates than Yii 1.0. Many of the extra features in Symfony vs Yii 1 are already proposed to be in Yii 2 (e.g. composer package manager dependency, asset bundles).

I would rather compare enhancements in Yii 2.0 over Yii 1.0, than Symfony at this stage. This may help your decision to some extent. Summary of some of the features which have been simplified for the developer are:


[*]Namespaces: Obvious to understand - using classes have never been easier without having naming conflicts

[*]Addition of View object (to complete the MVC architecture) - one of the better additions to allow theming much better (allowed me to create couple of extensions already)

[*]Separation of Component and Object. Also related to this is enhancements to events

[*]Assets & Asset bundles (related to View component)

[*]Better Models. Models now have a formName method to relate to the form. New useful methods load and loadMultiple to load user POST data. Enhanced method to define scenarios.

[*]Controller rendering enhancements. I feel its better to have a return method as available in Yii2 (for render and redirect). Enables to extend controllers and controller actions better than the previous versions where it was echo-ing the outputs.

[*]Widget usage enhancements (begin and end)

[*]PECL intl PHP module for I18n

[*]Inbuilt support for TWITTER BOOTSTRAP 3.0

[*]ActiveForm and ActiveField dramatically enhanced for point 9 above

[*]Wide array of Static Helpers (check the yii\helpers)

[*]URL Management: A major enhancement is that it now supports optional parameters.

[*]IdentityInterface instead of UserIdentity class… little enhancements in form of hashing etc… allowing a faster development of user authentication module

[*]Obvious one: COMPOSER dependency manager to manage package dependencies

[*]Obvious one: ACTIVE RECORD enhancements

[*]Obvious one: Improved QUERY BUILDER


Thank you for such complete reply.

I know it’s unfair to compare with a framework that have been out for quite some time now. But that’s is my dilemma, I liked working with Yii1 in the past, but I saw the drawbacks of using a framework which still supports PHP 5.2. We are currently using Zend1 and we may move forward to a new framework in, let’s day, 6 months, and I have been given the task to propose some alternatives. That’s why I have throwed the question here, as I may hear some other people ideas and maybe somebody in the same situation.

For people reading this now I might state that this problem has been solved well already.

Are there more issues that are marked “wont fix”? Afair the question about joining relations has always been asked the wrong way so it got won’t fix as we did not want to go back to 1.1. solution. Maybe same communication issue exists with other things?

I was totally desperate at the moment of writing that post, so I just can delete it.

Sure they do.

Different people need so solve different tasks, and sometimes what they need is not in plans for framework development.

As for me, I process datasets, so the dropped RAR joins (and the proposed solution for that - using non-DRY ugly join) was like the end of the world. So I went out to see the world and noticed that almost every framework use two-query approach to RAR (select from main + select from related where main_id in …) without ability to filter on relation. I suppose this is good for some noSQL magic, but hey dude where’s my join? :)

Sorry guys, I’m an emotional person, so as you can see my posts are like “OMG Yii2 is awesome!”, “Oh noes, I’ll downgrade”, “Hey check this out, it’s unbelievable!” and so on.

You know, my opinion is still in alpha, I expect it it to become stable in early 2014 :D

PS. But I still think that this is totally ugly, and I’m not gonna change my mind.

Currently I’m dealing with it by using ugly getters: public function getFull_name(). At least, they’re hidden inside models )

To solve your PS we need a full featured configurable schema to data mapper that will complicate things a lot without gaining much.

You may get some inspiration from this project: