+ component & twig function/filter for inject assets from manifest.json
This commit is contained in:
22
Plugin.php
22
Plugin.php
@ -2,6 +2,8 @@
|
||||
|
||||
use Backend;
|
||||
use System\Classes\PluginBase;
|
||||
use Wpstudio\AssetsManifest\Classes\TwigFilters;
|
||||
use Wpstudio\Assetsmanifest\Components\Manifest;
|
||||
|
||||
/**
|
||||
* assetsmanifest Plugin Information File
|
||||
@ -16,8 +18,8 @@ class Plugin extends PluginBase
|
||||
public function pluginDetails()
|
||||
{
|
||||
return [
|
||||
'name' => 'assetsmanifest',
|
||||
'description' => 'No description provided yet...',
|
||||
'name' => 'Assets manifest',
|
||||
'description' => 'Assets with manifest.json',
|
||||
'author' => 'wpstudio',
|
||||
'icon' => 'icon-leaf'
|
||||
];
|
||||
@ -50,10 +52,8 @@ class Plugin extends PluginBase
|
||||
*/
|
||||
public function registerComponents()
|
||||
{
|
||||
return []; // Remove this line to activate
|
||||
|
||||
return [
|
||||
'Wpstudio\Assetsmanifest\Components\MyComponent' => 'myComponent',
|
||||
Manifest::class => 'manifest',
|
||||
];
|
||||
}
|
||||
|
||||
@ -93,4 +93,16 @@ class Plugin extends PluginBase
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
public function registerMarkupTags()
|
||||
{
|
||||
return [
|
||||
'filters' => [
|
||||
'manifest' => [TwigFilters::class, 'manifest'],
|
||||
],
|
||||
'functions' => [
|
||||
'manifest' => [TwigFilters::class, 'manifest'],
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user