forked from Goomento/PageBuilderSampleData
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEntryPoint.php
66 lines (60 loc) · 1.62 KB
/
EntryPoint.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
/**
* @package Goomento_PageBuilderSampleData
* @link https://github.com/Goomento/PageBuilderSampleData
*/
declare(strict_types=1);
namespace Goomento\PageBuilderSampleData;
use Goomento\PageBuilderSampleData\Builder\Widgets\HelloWorld;
use Goomento\PageBuilder\Builder\Managers\Elements;
use Goomento\PageBuilder\Builder\Managers\Widgets;
use Goomento\PageBuilder\BuilderRegister;
use Goomento\PageBuilder\Helper\ThemeHelper;
class EntryPoint extends BuilderRegister
{
/**
* Add widget categories, where is grouping the similar widget types
*
*/
public function registerWidgetCategories(Elements $elements)
{
$elements->addCategory('sampledata', [
'title' => __('Sample Data'),
]);
}
/**
* Add to queue your css files, that can be used by widget or theme later
*
* @return void
*/
public function registerStyles()
{
ThemeHelper::registerStyle(
'pagebuilder-sample-data-widget',
'Goomento_PageBuilderSampleData/css/widget.css'
);
}
/**
* Add to queue your js files, that can be used by widget
*
* @return void
*/
public function registerScripts()
{
ThemeHelper::registerScript(
'pagebuilder-sample-data-bubbling',
'Goomento_PageBuilderSampleData/js/bubbling'
);
}
/**
* Add your widgets to be used here
*
* @see Widgets::registerWidgetType()
*/
public function registerWidgets(Widgets $widgetsManager)
{
$widgetsManager->registerWidgetType(
HelloWorld::class
);
}
}