Yii2 With Namespaces And Yii2 Without Namespaces

Is it possible to create two Yii2? First Yii2 will be with namespaces. But if developers don’t need namespaces in their project there is second Yii2 without namespaces.

Why? Whats wrong with just using them?

Also there are many things that rely on namespaces to work properly, this is not possible and also not wanted.

  1. It is difficult to understand in some circumstances

  2. It is more slowly performance

  3. There is no namespaces in older versions of PHP

I am not using namespaces on my small projects because it is difficult. It is my own opinion only.

There is nothing difficult about it. It is similar to aliases in Yii1.1

It is a core concept of PHP now and as PHP developer you should learn how it works.

What makes you think that? As it is used for autoloading, one could argue that by not using php include path anymore it gets faster rather than slower.

This is why minimum requirement is PHP 5.3 which also has reached end of life already and only gets security fixes.

You really should upgrade to a higher version if you are still using PHP < 5.3. Don’t fear learning new things! ;)

egorpromo I recommend you to use nice IDE with namespace support like Netbeans or PHPStorm. It will help you with importing stuff.

Difficult tu understand dont means unnecessary. If you need help tu understand namespaces, just make your questions here. Namespaces are very very important.

You also do not need to understand namespaces to use the framework. It just works. If you’re doing heavy development you will need to but then by this point you should have learnt namespaces.