You are here

public function TipPluginImageLegacy::getConfigurationOrNot in Drupal 9

File

core/modules/tour/tests/tour_test/src/Plugin/tour/tip/TipPluginImageLegacy.php, line 71

Class

TipPluginImageLegacy
Displays an image as a tip.

Namespace

Drupal\tour_test\Plugin\tour\tip

Code

public function getConfigurationOrNot() {
  $image = [
    '#theme' => 'image',
    '#uri' => $this
      ->get('url'),
    '#alt' => $this
      ->get('alt'),
  ];
  return [
    'title' => Html::escape($this
      ->get('label')),
    'body' => $this->token
      ->replace(\Drupal::service('renderer')
      ->renderPlain($image)),
  ];
}