I developing a site with two different registrations, and I have 2 different table, Im using RbacDB, and in the web config in the components section I have user configuration, according to this I want to know how I can use 2 different fields in the config file?
config :
'components' => [
'request' => [
// !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
'cookieValidationKey' => '213h2i3121h12osiajls',
],
'cache' => [
'class' => 'yii\caching\FileCache',
],
'user' => [
'identityClass' => 'app\models\User',
'enableAutoLogin' => true,
],
// Here after user I need to add another config user-two
'user-two' => [
'identityClass' => 'app\models\SecondUser',
'enableAutoLogin' => true,
],
when I do it, shows this error enter image description here
Thanks!
Try to set a class property in the user-two component:
or create new class inherited from the yii\web\User class and set like this:
Maybe this will help you.