How to login from different tables in Yii2

Comparing #8 with #11

Content

The Problem: Yii2 utilizes by default UserIdentity configured in config/web.php for connection, this object apply one table to authentication ('identityClass' => 'app\painel\models\User'). How to authentication from diferent tables?
Solution:
Create instances in web.php to uses UserIdentify.
[...]
'loginUrl' => ['dashboard-teacher/login'],
'identityCookie' => [
'name' => '_pa
inelTeacher',
]
],
[...]
```

Model scho
lol:

```php
[...]
```php
<?php if (!\Yii::$app->scholl->isGuest):?>
<h1>My scho
lol Name: <?=\Yii::$app->scholl->identity->name?>
<?php endif;?>
[...]
Criticism, suggestions and improvements, use the comments

[
https://www.next4.com.br/contato](Agência Next4 Comunicação Digital Ltda.](https://www.next4.com.br/contato)