Yii v2 snippet guide

Comparing #33 with #34

Revision #34 was created by rackycz rackycz on Sep 20, 2019, 11:05:05 AM.

db

Content

[...]
- The new model will only have 3 methods: tableName(), rules(), attributeLabels()
- In order to use the DB for login, we need to implement IdentityInterface which requires [5 new methods](https://www.yiiframework.com/doc/api/2.0/yii-web-identityinterface). But as I do not need all those methods, in some of them I have commented out their body in the example below.

The final model should look like this:

```
PHPphp
<?php

namespace app\models;

use Yii;
[...]