-
Notifications
You must be signed in to change notification settings - Fork 4
/
Plugin.php
42 lines (35 loc) · 1.15 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
<?php
declare(strict_types=1);
namespace Vdlp\Glide;
use System\Classes\PluginBase;
use Vdlp\Glide\Classes\GlideHelper;
use Vdlp\Glide\ServiceProviders\GlideServiceProvider;
class Plugin extends PluginBase
{
public function pluginDetails(): array
{
return [
'name' => 'vdlp.glide::lang.plugin.name',
'description' => 'vdlp.glide::lang.plugin.description',
'author' => 'Van der Let & Partners <octobercms@vdlp.nl>',
'icon' => 'icon-link',
'homepage' => 'https://octobercms.com/plugin/vdlp-glide',
];
}
public function register(): void
{
$this->app->register(GlideServiceProvider::class);
}
public function registerMarkupTags(): array
{
return [
'filters' => [
'thumb' => static function (?string $path = null, array $options = [], ?string $servername = null): string {
/** @var GlideHelper $helper */
$helper = resolve(GlideHelper::class);
return $helper->createThumbnail($path, $options, $servername);
},
],
];
}
}