function TipPluginBase::getLocation

Same name in other branches
  1. 9 core/modules/tour/src/TipPluginBase.php \Drupal\tour\TipPluginBase::getLocation()
  2. 11.x core/modules/tour/src/TipPluginBase.php \Drupal\tour\TipPluginBase::getLocation()

Overrides TipPluginInterface::getLocation

File

core/modules/tour/src/TipPluginBase.php, line 71

Class

TipPluginBase
Defines a base tour item implementation.

Namespace

Drupal\tour

Code

public function getLocation() : ?string {
    $location = $this->get('position');
    // The location values accepted by PopperJS, the library used for
    // positioning the tip.
    assert(in_array(trim($location ?? ''), [
        'auto',
        'auto-start',
        'auto-end',
        'top',
        'top-start',
        'top-end',
        'bottom',
        'bottom-start',
        'bottom-end',
        'right',
        'right-start',
        'right-end',
        'left',
        'left-start',
        'left-end',
        '',
    ], TRUE), "{$location} is not a valid Tour Tip position value");
    return $location;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.