Revision #3 has been created by AndroideLP on Apr 3, 2018, 11:34:00 PM with the memo:
error in code tag
« previous (#2) next (#4) »
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
[...]
```
My config/web.php
```php
'user' => [
'class'=>'yii\web\User',
'identityClass' => 'app\models\User',[...]
],
```
Note for each there is a identifyClass and one view login.
Now, we need to create the models:[...]
```php
//behaviors of the school
public function behaviors()
{[...]
```php
<?php if (!\Yii::$app->scholl->isGuest):?>
<h1>My scholl Name: <?=\Yii::$app->scholl->identity->name?>
<?php endif;?>
<?php if (!\Yii::$app->teacher->isGuest):?>
<h1>Teacher Name: <?=\Yii::$app->teacher->identity->name?>[...]