You are here

trait RangeSliderTrait in Range Slider 8

Class RangeSliderTrait.

Hierarchy

1 file declares its use of RangeSliderTrait
RangeSliderWidget.php in src/Plugin/Field/FieldWidget/RangeSliderWidget.php

File

src/RangeSliderTrait.php, line 10

Namespace

Drupal\range_slider
View source
trait RangeSliderTrait {
  use StringTranslationTrait;

  /**
   * Get orientation options.
   */
  public function getOrientationOptions() {
    return [
      'horizontal' => $this
        ->t('Horizontal'),
      'vertical' => $this
        ->t('Vertical'),
    ];
  }

  /**
   * Get output options.
   */
  public function getOutputOptions() {
    return [
      'below' => $this
        ->t('Below'),
      'above' => $this
        ->t('Above'),
      'left' => $this
        ->t('Left'),
      'right' => $this
        ->t('Right'),
    ];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
RangeSliderTrait::getOrientationOptions public function Get orientation options.
RangeSliderTrait::getOutputOptions public function Get output options.
StringTranslationTrait::$stringTranslation protected property The string translation service. 1
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.