You are here

public function TipPluginText::getAttributes in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/tour/src/Plugin/tour/tip/TipPluginText.php \Drupal\tour\Plugin\tour\tip\TipPluginText::getAttributes()

Returns an array of attributes for the tip wrapper.

Return value

array An array of classes and values.

Overrides TipPluginBase::getAttributes

File

core/modules/tour/src/Plugin/tour/tip/TipPluginText.php, line 108
Contains \Drupal\tour\Plugin\tour\tip\TipPluginText.

Class

TipPluginText
Displays some text as a tip.

Namespace

Drupal\tour\Plugin\tour\tip

Code

public function getAttributes() {
  $attributes = parent::getAttributes();
  $attributes['data-aria-describedby'] = 'tour-tip-' . $this
    ->getAriaId() . '-contents';
  $attributes['data-aria-labelledby'] = 'tour-tip-' . $this
    ->getAriaId() . '-label';
  if ($location = $this
    ->get('location')) {
    $attributes['data-options'] = 'tipLocation:' . $location;
  }
  return $attributes;
}