public Translation::__construct(array $values)
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.
array $values: Possible array keys:
public function __construct(array $values) { $string = $values['value']; $arguments = isset($values['arguments']) ? $values['arguments'] : array(); $options = array(); if (!empty($values['context'])) { $options = array( 'context' => $values['context'], ); } $this->translation = new TranslatableMarkup($string, $arguments, $options); }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Annotation!Translation.php/function/Translation::__construct/8.1.x