forked from hechoendrupal/drupal-console
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathimageeffect.php.twig
More file actions
35 lines (31 loc) · 838 Bytes
/
Copy pathimageeffect.php.twig
File metadata and controls
35 lines (31 loc) · 838 Bytes
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
{% extends "base/class.php.twig" %}
{% block file_path %}
Drupal\{{module}}\Plugin\ImageEffect\{{class_name}}.
{% endblock %}
{% block namespace_class %}
namespace Drupal\{{module}}\Plugin\ImageEffect;
{% endblock %}
{% block use_class %}
use Drupal\Core\Image\ImageInterface;
use Drupal\image\ImageEffectBase;
{% endblock %}
{% block class_declaration %}
/**
* Provides a '{{class_name}}' image effect.
*
* @ImageEffect(
* id = "{{plugin_id}}",
* label = @Translation("{{label}}"),
* description = @Translation("{{description}}")
* )
*/
class {{ class_name }} extends ImageEffectBase {% endblock %}
{% block class_methods %}
/**
* {@inheritdoc}
*/
public function applyEffect(ImageInterface $image) {
// Implement Image Effect.
return imagefilter($image->getToolkit()->getResource());
}
{% endblock %}