abstract class TipPluginBase

Defines a base tour implementation.

Hierarchy

Expanded class hierarchy of TipPluginBase

2 files declare their use of TipPluginBase
TipPluginImage.php in drupal/core/modules/tour/tests/tour_test/lib/Drupal/tour_test/Plugin/tour/tip/TipPluginImage.php
Contains \Drupal\tour_test\Plugin\tour\tour\TipPluginImage.
TipPluginText.php in drupal/core/modules/tour/lib/Drupal/tour/Plugin/tour/tip/TipPluginText.php
Contains \Drupal\tour\Plugin\tour\tip\TipPluginText.

File

drupal/core/modules/tour/lib/Drupal/tour/TipPluginBase.php, line 16
Contains \Drupal\tour\TipPluginBase.

Namespace

Drupal\tour
View source
abstract class TipPluginBase extends PluginBase implements TipPluginInterface {

  /**
   * The label which is used for render of this tip.
   *
   * @var string
   */
  protected $label;

  /**
   * Allows tips to take more priority that others.
   *
   * @var string
   */
  protected $weight;

  /**
   * The attributes that will be applied to the markup of this tip.
   *
   * @var array
   */
  protected $attributes;

  /**
   * Implements \Drupal\tour\TipPluginInterface::getLabel().
   */
  public function getLabel() {
    return $this
      ->get('label');
  }

  /**
   * Implements \Drupal\tour\TipPluginInterface::getWeight().
   */
  public function getWeight() {
    return $this
      ->get('weight');
  }

  /**
   * Implements \Drupal\tour\TipPluginInterface::getAttributes().
   */
  public function getAttributes() {
    return $this
      ->get('attributes');
  }

  /**
   * Implements \Drupal\tour\TipPluginInterface::get().
   */
  public function get($key) {
    if (!empty($this->configuration[$key])) {
      return $this->configuration[$key];
    }
  }

  /**
   * Implements \Drupal\tour\TipPluginInterface::set().
   */
  public function set($key, $value) {
    $this->configuration[$key] = $value;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
PluginBase::$configuration protected property Configuration information passed into the plugin. 1
PluginBase::$pluginDefinition protected property The plugin implementation definition.
PluginBase::$pluginId protected property The plugin_id.
PluginBase::getPluginDefinition public function Returns the definition of the plugin implementation. Overrides PluginInspectionInterface::getPluginDefinition
PluginBase::getPluginId public function Returns the plugin_id of the plugin instance. Overrides PluginInspectionInterface::getPluginId
PluginBase::__construct public function Constructs a Drupal\Component\Plugin\PluginBase object. 17
TipPluginBase::$attributes protected property The attributes that will be applied to the markup of this tip.
TipPluginBase::$label protected property The label which is used for render of this tip.
TipPluginBase::$weight protected property Allows tips to take more priority that others.
TipPluginBase::get public function Implements \Drupal\tour\TipPluginInterface::get(). Overrides TipPluginInterface::get
TipPluginBase::getAttributes public function Implements \Drupal\tour\TipPluginInterface::getAttributes(). Overrides TipPluginInterface::getAttributes 1
TipPluginBase::getLabel public function Implements \Drupal\tour\TipPluginInterface::getLabel(). Overrides TipPluginInterface::getLabel
TipPluginBase::getWeight public function Implements \Drupal\tour\TipPluginInterface::getWeight(). Overrides TipPluginInterface::getWeight
TipPluginBase::set public function Implements \Drupal\tour\TipPluginInterface::set(). Overrides TipPluginInterface::set
TipPluginInterface::getOutput public function Returns a renderable array. 2