Possible to avoid multiple "use" statements in project

Hi all,

I am currently in the process of upgrading my application from Yii 1.1 to Yii 2.0 and have a question regarding "use" statements.

From what I understand the old way of importing all classes you want access to though a config file is no longer an option so the only way to get access the core components like "HTML" is to include a "use yii\helpers\Html" statement in every file that needs it.

Is this correct, or am I misunderstanding how the autoloader works in Yii 2.0?

Any help greatly appreciated.

in yii2, you should use the namespace as you mentioned.

Also, the autoloader works differently. in yii1, you could see the framework classes starting with C.

in yii2, you can use the class names with same name of framework classes. Whatever classes we "use" with the namespaces will only be considered in the code.

It’s PHP.

Ok thanks for the replies.