forked from oc-shopaholic/oc-good-news-plugin
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Plugin.php
52 lines (46 loc) · 1.38 KB
/
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php namespace Lovata\GoodNews;
use Event;
use System\Classes\PluginBase;
//Event
use Lovata\GoodNews\Classes\Event\ArticleModelHandler;
use Lovata\GoodNews\Classes\Event\CategoryModelHandler;
/**
* Class Plugin
* @package Lovata\GoodNews
* @author Andrey Kahranenka, [email protected], LOVATA Group
*/
class Plugin extends PluginBase
{
/** @var array Plugin dependencies */
public $require = ['Lovata.Toolbox'];
/**
* Registration components
* @return array
*/
public function registerComponents()
{
return [
'Lovata\GoodNews\Components\ArticleList' => 'ArticleList',
'Lovata\GoodNews\Components\ArticlePage' => 'ArticlePage',
'Lovata\GoodNews\Components\ArticleData' => 'ArticleData',
'Lovata\GoodNews\Components\ArticleCategoryList' => 'ArticleCategoryList',
'Lovata\GoodNews\Components\ArticleCategoryPage' => 'ArticleCategoryPage',
'Lovata\GoodNews\Components\ArticleCategoryData' => 'ArticleCategoryData',
];
}
/**
* Plugin boot method
*/
public function boot()
{
$this->addEventListener();
}
/**
* Add event listeners
*/
protected function addEventListener()
{
Event::subscribe(ArticleModelHandler::class);
Event::subscribe(CategoryModelHandler::class);
}
}