public function TipPluginImage::getOutput in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/modules/tour/tests/tour_test/src/Plugin/tour/tip/TipPluginImage.php \Drupal\tour_test\Plugin\tour\tip\TipPluginImage::getOutput()
Returns a renderable array.
Return value
array A renderable array.
Overrides TipPluginInterface::getOutput
File
- core/
modules/ tour/ tests/ tour_test/ src/ Plugin/ tour/ tip/ TipPluginImage.php, line 42 - Contains \Drupal\tour_test\Plugin\tour\tip\TipPluginImage.
Class
- TipPluginImage
- Displays an image as a tip.
Namespace
Drupal\tour_test\Plugin\tour\tipCode
public function getOutput() {
$prefix = '<h2 class="tour-tip-label" id="tour-tip-' . $this
->get('ariaId') . '-label">' . Html::escape($this
->get('label')) . '</h2>';
$prefix .= '<p class="tour-tip-image" id="tour-tip-' . $this
->get('ariaId') . '-contents">';
return [
'#prefix' => $prefix,
'#theme' => 'image',
'#uri' => $this
->get('url'),
'#alt' => $this
->get('alt'),
'#suffix' => '</p>',
];
}