You are here

public function TipPluginText::getAttributes in Drupal 8

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 109

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;
}