-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathPlugin.php
44 lines (35 loc) · 1007 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
35
36
37
38
39
40
41
42
43
44
<?php
namespace Metabase;
use MapasCulturais\App;
class Plugin extends \MapasCulturais\Plugin
{
function __construct($config = [])
{
$config += [
'links' => [],
'cards' => [],
];
parent::__construct($config);
}
public function _init()
{
$app = App::i();
//load css
$app->hook('<<GET|POST>>(<<metabase|site>>.<<*>>)', function() use ($app) {
$app->view->enqueueStyle('app-v2', 'metabase', 'css/plugin-Metabase.css');
});
$app->hook("component(home-feature):after", function() {
/** @var \MapasCulturais\Theme $this */
$this->part('home-metabase');
});
$self= $this;
$app->hook("app.init:after", function() use ($self){
$this->view->metabasePlugin = $self;
});
}
public function register()
{
$app = App::i();
$app->registerController('metabase', Controllers\Metabase::class);
}
}