Using Yii2 advanced I need to unload a little code in the Controller.
I want to create a third-party class and use it. I made a folder in common and wrote a class in it, specified a namespace , and connected it ( use ) in the controller. But it gives an error - such a class does not exist!
Class, just to unload the code in the controller, that is, in several controllers some work is done (the same), I want to make a class to call functions from it - this will significantly reduce the amount of code, and make it more rational!
In commom, I made the classes directory, and in it the UploadWorker class.
In this class I specify: namespace common/classes;
And where I create this class: use common/classes/UploadWorker ;
An error says about a non-existent class along this path!
How to properly implement such a task? Where to create? And how to connect the class?