Loading models and controller in config

Hello Guru,

Am facing an issue on keeping calling Classes when when ever i want to use it ,is there the way out to load all models,helpers and other defaults classes so that they may be auto loader when when ever i start the application,like the way we were doing in yii 1.*,

That all common classes where loaded in config/main.php file just once.





thanks and regards

I don’t suppose you can really do that with yii2 you have to exliplity load what you need namespaces serve that very purpose

We don’t have to do that anymore in Yii 2.

That is already done by means of the Composer autoloader and the Yii composer extensions.

This is the reason why we can just require a package and directly use it.

And a good reason to learn Composer and learn to love it ;)