public function TipPluginImage::getOutput

Overrides \Drupal\tour\Plugin\tour\tour\TipPluginInterface::getOutput().

Overrides TipPluginInterface::getOutput

File

drupal/core/modules/tour/tests/tour_test/lib/Drupal/tour_test/Plugin/tour/tip/TipPluginImage.php, line 39
Contains \Drupal\tour_test\Plugin\tour\tour\TipPluginImage.

Class

TipPluginImage
Displays an image as a tip.

Namespace

Drupal\tour_test\Plugin\tour\tip

Code

public function getOutput() {
  $image = array(
    '#theme' => 'image',
    '#uri' => $this
      ->get('url'),
    '#alt' => $this
      ->get('alt'),
  );
  $output = '<h2 class="tour-tip-label" id="tour-tip-' . $this
    ->get('ariaId') . '-label">' . check_plain($this
    ->get('label')) . '</h2>';
  $output .= '<p class="tour-tip-image" id="tour-tip-' . $this
    ->get('ariaId') . '-contents">' . drupal_render($image) . '</p>';
  return array(
    '#markup' => $output,
  );
}