Yii::configure does not work in module init()

Hi. I have a module calls API, and i want to load config file for it. The guide says that i have to use function \Yii::configure. I use it, but it doesn’t apply any new configs. And i tried to use array instead config file, the result is same.

class API extends \yii\base\Module


    public $controllerNamespace = 'api\client\controllers';

    public function init()



//        \Yii::configure($this, require(__DIR__ . '/config/main.php'));


        \yii::configure($this, [

            'components' => [

                'user' => [

                    'class' => 'yii\web\UserTest',

                    'identityClass' => 'api\client\models\User',





        echo \yii::$app->user->className();





How I can override config in my module ?