function TipPluginImage::getBody

Same name in other branches
  1. 9 core/modules/tour/tests/tour_test/src/Plugin/tour/tip/TipPluginImage.php \Drupal\tour_test\Plugin\tour\tip\TipPluginImage::getBody()
  2. 11.x core/modules/tour/tests/tour_test/src/Plugin/tour/tip/TipPluginImage.php \Drupal\tour_test\Plugin\tour\tip\TipPluginImage::getBody()

Overrides TipPluginBase::getBody

File

core/modules/tour/tests/tour_test/src/Plugin/tour/tip/TipPluginImage.php, line 70

Class

TipPluginImage
Displays an image as a tip.

Namespace

Drupal\tour_test\Plugin\tour\tip

Code

public function getBody() : array {
    $image = [
        '#theme' => 'image',
        '#uri' => $this->get('url'),
        '#alt' => $this->get('alt'),
    ];
    return [
        '#type' => 'html_tag',
        '#tag' => 'p',
        '#attributes' => [
            'class' => [
                'tour-tip-image',
            ],
        ],
        'image' => $image,
    ];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.