I'm using xampp for windows 8 and i have recently installed dektrium/yii2-user
.
I have followed the installation instructions here:
https://github.com/dektrium/yii2-user/blob/master/docs/installation.md
The changed part of my web.php looks now like this:
'user' => [
'identityClass' => 'app\models\User',
'enableAutoLogin' => true,
'class' => 'dektrium\user\Module',
],
I'm getting the error:
Missing required parameter "id" when instantiating "dektrium\user\Module".
And when I delete
'class' => 'dektrium\user\Module',
the error disappears.
Most likely you inserted this line in the wrong section (components
):
'components' => [
'user' => [
'identityClass' => 'app\models\User',
'enableAutoLogin' => true,
// You inserted it here
],
],
But yii2-user
is not component, it's module. Therefore you should include this in modules
section of config
. It also mentioned in documentation:
'modules' => [
'user' => [
'class' => 'dektrium\user\Module',
],
],
Right after installation basic application does not have any modules so in that case you should create this section by yourself.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With