interface TipPluginInterface

Same name in other branches
  1. 9 core/modules/tour/src/TipPluginInterface.php \Drupal\tour\TipPluginInterface
  2. 8.9.x core/modules/tour/src/TipPluginInterface.php \Drupal\tour\TipPluginInterface
  3. 11.x core/modules/tour/src/TipPluginInterface.php \Drupal\tour\TipPluginInterface

Defines an interface for tour items.

Hierarchy

Expanded class hierarchy of TipPluginInterface

All classes that implement TipPluginInterface

See also

\Drupal\tour\Annotation\Tip

\Drupal\tour\TipPluginBase

\Drupal\tour\TipPluginManager

Plugin API

1 string reference to 'TipPluginInterface'
tour.schema.yml in core/modules/tour/config/schema/tour.schema.yml
core/modules/tour/config/schema/tour.schema.yml

File

core/modules/tour/src/TipPluginInterface.php, line 13

Namespace

Drupal\tour
View source
interface TipPluginInterface {
    
    /**
     * Returns id of the tip.
     *
     * @return string
     *   The id of the tip.
     */
    public function id();
    
    /**
     * Returns label of the tip.
     *
     * @return string
     *   The label of the tip.
     */
    public function getLabel();
    
    /**
     * Returns weight of the tip.
     *
     * @return string
     *   The weight of the tip.
     */
    public function getWeight();
    
    /**
     * Used for returning values by key.
     *
     * @var string
     *   Key of the value.
     *
     * @return string
     *   Value of the key.
     */
    public function get($key);
    
    /**
     * Returns the selector the tour tip will attach to.
     *
     * This typically maps to the Shepherd Step options `attachTo.element`
     * property.
     *
     * @return null|string
     *   A selector string, or null for an unattached tip.
     *
     * @see https://shepherdjs.dev/docs/Step.html
     */
    public function getSelector() : ?string;
    
    /**
     * Returns the body content of the tooltip.
     *
     * This typically maps to the Shepherd Step options `text` property.
     *
     * @return array
     *   A render array.
     *
     * @see https://shepherdjs.dev/docs/Step.html
     */
    public function getBody() : array;
    
    /**
     * Returns the configured placement of the tip relative to the element.
     *
     * If null, the tip will automatically determine the best position based on
     * the element's position in the viewport.
     *
     * This typically maps to the Shepherd Step options `attachTo.on` property.
     *
     * @return string|null
     *   The tip placement relative to the element.
     *
     * @see https://shepherdjs.dev/docs/Step.html
     */
    public function getLocation() : ?string;
    
    /**
     * Used for returning values by key.
     *
     * @var string
     *   Key of the value.
     *
     * @var string
     *   Value of the key.
     */
    public function set($key, $value);

}

Members

Title Sort descending Modifiers Object type Summary Overrides
TipPluginInterface::get public function Used for returning values by key. 1
TipPluginInterface::getBody public function Returns the body content of the tooltip. 1
TipPluginInterface::getLabel public function Returns label of the tip. 1
TipPluginInterface::getLocation public function Returns the configured placement of the tip relative to the element. 1
TipPluginInterface::getSelector public function Returns the selector the tour tip will attach to. 1
TipPluginInterface::getWeight public function Returns weight of the tip. 1
TipPluginInterface::id public function Returns id of the tip. 1
TipPluginInterface::set public function Used for returning values by key. 1

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