You are here

protected function TextimageFactory::getTokenReplacement in Textimage 8.4

Same name and namespace in other branches
  1. 8.3 src/TextimageFactory.php \Drupal\textimage\TextimageFactory::getTokenReplacement()

Helper method to determine the token value in processTokens.

1 call to TextimageFactory::getTokenReplacement()
TextimageFactory::processTokens in src/TextimageFactory.php
Textimage tokens replacement.

File

src/TextimageFactory.php, line 500

Class

TextimageFactory
Provides a factory for Textimage.

Namespace

Drupal\textimage

Code

protected function getTokenReplacement(TextimageInterface $textimage, $key) {
  switch ($key) {
    case 'uri':
      return $textimage
        ->getUri();
    case 'url':
      return $textimage
        ->getUrl()
        ->toString();
  }
}