function TranslatableMarkup::getOption

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php \Drupal\Core\StringTranslation\TranslatableMarkup::getOption()
  2. 10 core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php \Drupal\Core\StringTranslation\TranslatableMarkup::getOption()
  3. 11.x core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php \Drupal\Core\StringTranslation\TranslatableMarkup::getOption()

Gets a specific option from this translated string.

Parameters

string $name: Option name.

Return value

mixed The value of this option or empty string of option is not set.

1 call to TranslatableMarkup::getOption()
PluralTranslatableMarkup::getPluralIndex in core/lib/Drupal/Core/StringTranslation/PluralTranslatableMarkup.php
Gets the plural index through the gettext formula.

File

core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php, line 158

Class

TranslatableMarkup
Provides translatable markup class.

Namespace

Drupal\Core\StringTranslation

Code

public function getOption($name) {
    return $this->options[$name] ?? '';
}

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