You are here

public function TranslationWrapper::__construct in Service Container 7.2

Same name and namespace in other branches
  1. 7 lib/Drupal/Core/StringTranslation/TranslationWrapper.php \Drupal\Core\StringTranslation\TranslationWrapper::__construct()

Constructs a new class instance.

Parses values passed into this class through the t() function in Drupal and handles an optional context for the string.

Parameters

string $string: The string that is to be translated.

array $arguments: (optional) An array with placeholder replacements, keyed by placeholder.

array $options: (optional) An array of additional options.

File

lib/Drupal/Core/StringTranslation/TranslationWrapper.php, line 55
Contains \Drupal\Core\StringTranslation\TranslationWrapper.

Class

TranslationWrapper
Provides a class to wrap a translatable string.

Namespace

Drupal\Core\StringTranslation

Code

public function __construct($string, array $arguments = array(), array $options = array()) {
  $this->string = $string;
  $this->arguments = $arguments;
  $this->options = $options;
}