ja.son-williams.ca/www/plugins/jasonwilliams/imgcache/Plugin.php
2021-01-02 18:31:29 -07:00

35 lines
884 B
PHP

<?php namespace JasonWilliams\ImgCache;
/**
* The plugin.php file (called the plugin initialization script) defines the plugin information class.
*/
use System\Classes\PluginBase;
use JasonWilliams\ImgCache\Classes\Image;
class Plugin extends PluginBase
{
public function pluginDetails()
{
return [
'name' => 'Image Cache',
'description' => 'Saves external images locally and presents them via a twig filter.',
'author' => 'Jason Williams',
'icon' => 'oc-icon-cloud'
];
}
public function registerMarkupTags()
{
return [
'filters' => [
'imgcache' => function($imgurl) {
$image = new Image($imgurl);
return $image;
}
]
];
}
}