You are here

public function TextOverlayImageEffect::__construct in Image Effects 8

Same name and namespace in other branches
  1. 8.3 src/Plugin/ImageEffect/TextOverlayImageEffect.php \Drupal\image_effects\Plugin\ImageEffect\TextOverlayImageEffect::__construct()
  2. 8.2 src/Plugin/ImageEffect/TextOverlayImageEffect.php \Drupal\image_effects\Plugin\ImageEffect\TextOverlayImageEffect::__construct()

Constructs a TextOverlayImageEffect object.

Parameters

array $configuration: A configuration array containing information about the plugin instance.

string $plugin_id: The plugin_id for the plugin instance.

array $plugin_definition: The plugin implementation definition.

\Psr\Log\LoggerInterface $logger: A logger instance.

\Drupal\Core\Image\ImageFactory $image_factory: The image factory service.

\Drupal\image_effects\Plugin\ImageEffectsFontSelectorPluginInterface $font_selector_plugin: The font selector plugin.

\Drupal\Core\Utility\Token $token_service: The token resolution service.

\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler service.

Overrides ImageEffectBase::__construct

File

src/Plugin/ImageEffect/TextOverlayImageEffect.php, line 89

Class

TextOverlayImageEffect
Overlays text on the image, defining text font, size and positioning.

Namespace

Drupal\image_effects\Plugin\ImageEffect

Code

public function __construct(array $configuration, $plugin_id, array $plugin_definition, LoggerInterface $logger, ImageFactory $image_factory, ImageEffectsFontSelectorPluginInterface $font_selector_plugin, Token $token_service, ModuleHandlerInterface $module_handler) {
  parent::__construct($configuration, $plugin_id, $plugin_definition, $logger);
  $this->imageFactory = $image_factory;
  $this->fontSelector = $font_selector_plugin;
  $this->token = $token_service;
  $this->moduleHandler = $module_handler;
}