-
Notifications
You must be signed in to change notification settings - Fork 8
/
Plugin.php
43 lines (40 loc) · 967 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
<?php namespace Inetis\Dump;
use System\Classes\PluginBase;
/**
* Dump Plugin Information File
*/
class Plugin extends PluginBase
{
/**
* Returns information about this plugin.
*
* @return array
*/
public function pluginDetails()
{
return [
'name' => 'Twig Dump',
'description' => 'Add Twig function d() that recursively dump passed variables',
'author' => 'inetis',
'icon' => 'icon-code',
'homepage' => 'https://github.com/inetis-ch/oc-dump'
];
}
/**
* Register new Twig function
*
* @return array
*/
public function registerMarkupTags()
{
return [
'functions' => [
'd' => function () {
array_map(function ($x) {
dump($x);
}, func_get_args());
}
]
];
}
}