How to login from different tables in Yii2

Comparing #4 with #5

Revision #5 was created by AndroideLP AndroideLP on Apr 3, 2018, 11:36:02 PM.

error code php

Content

[...]
];
}

```
To use login:

 
```php
 
//school
\Yii::$app->scholl->login($model, $this->rememberMe ? 3600*24*30 : 0);
[...]
```

 
 
For restrict access in views:

```php

<?php if (!\Yii::$app->scholl->isGuest):?>
<h1>My scholl Name: <?=\Yii::$app->scholl->identity->name?>
[...]