New in Yii 2.0

Hi !

I’ve worked well with Yii 1, everything good and satisfying, but after working with Yii2 I found out that there are some of things twisted a bit!!

like that there is Namespace definition that didn’t exist in Yii1. If it is necessary, why it didn’t exist in the previous version?!

I don’t like to be concerned of what function i’m using in every single file, not to get Class Not Found errors and so on…

and Gii has changed in a twisted way too! that I should give direction to each CRUD I generate.

It’s abit weird and user unfriendly!

In a nutshell this is my question :

Why Yii2 (+Gii) has become more complicated while it was not in Yii1 ?

Never used Yii 2 yet so I may be wrong but I guess Yii 2 has moved on to the world of namespacing, and probably employed other things as well to comply with PSR-2 standards. Yii 1 revolved a lot around its alias system. You could still use namespaces just fine in Yii 1 but your namespaces had to match up with how yii defined its aliases for painless autoloading.

A lot of other PHP frameworks use namespaces a lot too so you probably might run into the same issues if ever you decide to try another framework.

Namespaces didn’t exist in PHP when the development of Yii 1.x began.

The PHP ecosystem is evolving. It’s not unusual to use dozens of third party libraries from different vendors in a project today. Namespaces solve the problem of class naming collisions which would be difficult to avoid without them.

Namespaces introduced in PHP in 2009. The community had almost six years to learn them, and it isn’t rocket science.

Thank you for your reply. sounds logical :)

but why in Gii, it needs to specify directories and searchModel has been separated ?

Thanks man! I’m convinced.