Difference between #3 and #4 of
How to login from different tables in Yii2

Revision #4 has been created by AndroideLP on Apr 3, 2018, 11:35:03 PM with the memo:

error code php
« previous (#3) next (#5) »

Changes

Title unchanged

How to login from different tables in Yii2

Category unchanged

How-tos

Yii version unchanged

2.0

Tags unchanged

authentication,login,different table name,multiple login

Content changed

The Problem: Yii2 utilizes by default UserIdentity configured in config/web.php for connection, this object appy one table to authentication ('identityClass' => 'app\painel\models\User'). How to authentication from diferent tables? Solution: Create instances in web.php to uses UserIdentify. eg:
 
```php
 
$user = \Yii::$app->user; $school = \Yii::$app->school; $teacher = \Yii::$app->teacher;
 
```
 
 
My config/web.php

```php

'user' => [
'class'=>'yii\web\User',
[...]
5 0
6 followers
Viewed: 61 621 times
Version: 2.0
Category: How-tos
Written by: AndroideLP
Last updated by: lenovo
Created on: Apr 3, 2018
Last updated: 3 years ago
Update Article

Revisions

View all history