0

I developing a site with two different registrations, and I have 2 different table, One is user and 2nd is admin.In the web.config how to I can set both tables in the components section. For this I am tried this my code is that :-

 'user' => [
        'identityClass' => 'app\models\Users',
        'enableAutoLogin' => true,
    ],
    'admin' => [
        //'class' => 'yii\web\User'
        'identityClass' => 'app\models\adminUser',
        'enableAutoLogin' => true,
    ],

But when run run my application its showing error message erro message is that :- Invalid Configuration – yii\base\InvalidConfigException I also tried this multiple user identity in config Yii2 when I add class its showing blank page. Thank you

Community
  • 1
  • 1
Renu Thakur
  • 551
  • 11
  • 35
  • What is the exact error message? You need `'class' => 'yii\web\User'` in `admin` component, uncomment it. – Bizley Aug 09 '16 at 07:28
  • @Bizely when I uncomment this line its showing blank website and when I comment its then error isInvalid Configuration – yii\base\InvalidConfigException The configuration for the "admin" component must contain a "class" element. – Renu Thakur Aug 09 '16 at 07:37
  • Leave it uncommented and remove the `enableAutoLogin` key. If this not helps check the runtime log and/or server log for other errors. – Bizley Aug 09 '16 at 07:42
  • 1
    Tough road. Already asked question : [How to login using two different model or switch identity class in yii2?](http://stackoverflow.com/questions/34959941/how-to-login-using-two-different-model-or-switch-identity-class-in-yii2) – Insane Skull Aug 09 '16 at 08:38

0 Answers0