Displays an image as a tip.
@Tip("image");
Expanded class hierarchy of TipPluginImage
class TipPluginImage extends TipPluginBase {
/**
* The url which is used for the image in this Tip.
*
* @var string
* A url used for the image.
*/
protected $url;
/**
* The alt text which is used for the image in this Tip.
*
* @var string
* A alt text used for the image.
*/
protected $alt;
/**
* Overrides \Drupal\tour\Plugin\tour\tour\TipPluginInterface::getOutput().
*/
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,
);
}
}
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
public | function |
Returns the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function |
Returns the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function | Constructs a Drupal\Component\Plugin\PluginBase object. | 17 |
TipPluginBase:: |
protected | property | The attributes that will be applied to the markup of this tip. | |
TipPluginBase:: |
protected | property | The label which is used for render of this tip. | |
TipPluginBase:: |
protected | property | Allows tips to take more priority that others. | |
TipPluginBase:: |
public | function |
Implements \Drupal\tour\TipPluginInterface::get(). Overrides TipPluginInterface:: |
|
TipPluginBase:: |
public | function |
Implements \Drupal\tour\TipPluginInterface::getAttributes(). Overrides TipPluginInterface:: |
1 |
TipPluginBase:: |
public | function |
Implements \Drupal\tour\TipPluginInterface::getLabel(). Overrides TipPluginInterface:: |
|
TipPluginBase:: |
public | function |
Implements \Drupal\tour\TipPluginInterface::getWeight(). Overrides TipPluginInterface:: |
|
TipPluginBase:: |
public | function |
Implements \Drupal\tour\TipPluginInterface::set(). Overrides TipPluginInterface:: |
|
TipPluginImage:: |
protected | property | The alt text which is used for the image in this Tip. | |
TipPluginImage:: |
protected | property | The url which is used for the image in this Tip. | |
TipPluginImage:: |
public | function |
Overrides \Drupal\tour\Plugin\tour\tour\TipPluginInterface::getOutput(). Overrides TipPluginInterface:: |