I just installed the Yii2-User module / Dektrium in my main Yii2-app with this command
composer require "dektrium/yii2-user:0.9.*@dev"
config /console.php
return [
.
.
'modules' => [
'gii' => 'yii\gii\Module',
'user' => [
'class' => 'dektrium\user\Module',
],
],
.
.
]
config /web.php
'components' => [
.
.
/*
'user' => [
'identityClass' => 'app\models\User',
'enableAutoLogin' => true,
],
*/
'modules' => [
'user' => [
'class' => 'dektrium\user\Module',
],
],
.
.
]
After that, I ran this command $ php yii migrate/up --migrationPath=@vendor/dektrium/yii2-user/migrations
to update the database schema.
But, when I launch http://localhost/mylawsuit/yii/web/index.php?r=user/registration/register
in my browser. This causes an error:
Incorrect configuration - yii \ base \ InvalidConfigException
The configuration of the "modules" component should contain a "class" element.
Error screenshot

And when I change web.php
'user' => [
'identityClass' => 'app\models\User',
'enableAutoLogin' => true,
],
/*
'modules' => [
'user' => [
'class' => 'dektrium\user\Module',
],
],
Entering http://localhost/mylawsuit/yii/web/index.php?r=user/registration/register
into my browser, it shows
Not Found (# 404)
Page not found.
Screenshot

I do not understand where I am mistaken. Please help me fix it.