I use the advanced application pattern.

I want to create a new directory in the root of the project and describe my structure there. Here is how it looks from me:

enter image description here

I'm trying to access the SuperTest class from the backend, for example.

enter image description here

Class connect so:

use modules\user\modules\v1\backend\models\SuperTest; 

As a result, I get the error: Class 'modules\user\modules\v1\backend\models\SuperTest' not found

As I understand it, the autoloader cannot load this class.

How can I make it so that I can work normally with a new directory?

    1 answer 1

    Child modules are declared in the modules property of the parent modules. For example:

     namespace backend\modules\user; class User extends \yii\base\Module { public function init() { parent::init(); $this->modules = [ 'v1' => [ 'class' => 'backend\modules\user\modules\v1\V1', ], ]; } } 

    The truth can not say anything about putting there the whole application, it never occurred to me