Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. TranslatableMarkup.php

function 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.

2 calls to TranslatableMarkup::getOption()
PluralTranslatableMarkup::getPluralIndex in core/lib/Drupal/Core/StringTranslation/PluralTranslatableMarkup.php
Gets the plural index through the gettext formula.
TranslatableStringAdapter::trans in core/modules/package_manager/src/TranslatableStringAdapter.php
Translates the message.

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] ?? '';
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal