Events registration examples

Comparing #2 with #3

Revision #3 was created by minitia minitia on Mar 11, 2019, 2:03:38 PM.

correction

Tags

events,yii2

Content

[...]
taked from
https://stackoverflow.com/questions/28575636/how-to-use-events-in-yii2

**Register an event handler at Class-Level**

To register event handle
rs at Class-Level a good place can be inside the bootstrap process.

So, you can put the registration code as

```php
Event::on(ActiveRecord::className(), ActiveRecord::EVENT_AFTER_INSERT, function ($event) {
[...]