forked from robuust/craft-reverserelations
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlugin.php
34 lines (30 loc) · 833 Bytes
/
Plugin.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
namespace robuust\reverserelations;
use craft\events\RegisterComponentTypesEvent;
use craft\services\Fields;
use robuust\reverserelations\fields\ReverseCategories;
use robuust\reverserelations\fields\ReverseEntries;
use yii\base\Event;
/**
* Reverse Relations Plugin.
*
* @author Bob Olde Hampsink <[email protected]>
* @copyright Copyright (c) 2019, Robuust
* @license MIT
*
* @see https://robuust.digital
*/
class Plugin extends \craft\base\Plugin
{
/**
* Initializes the plugin.
*/
public function init()
{
parent::init();
Event::on(Fields::class, Fields::EVENT_REGISTER_FIELD_TYPES, function (RegisterComponentTypesEvent $event) {
$event->types[] = ReverseCategories::class;
$event->types[] = ReverseEntries::class;
});
}
}