You are here

public function CurrentLangname::getValue in More Global Variables 8

Method that implement generating value of global variable.

Return value

mixed Return value of declared variable.

Overrides GlobalVariableInterface::getValue

File

src/Plugin/GlobalVariable/CurrentLangname.php, line 21

Class

CurrentLangname
Class CurrentLangname.

Namespace

Drupal\mgv\Plugin\GlobalVariable

Code

public function getValue() {

  // Print the current langname, e.g. 'english' or 'french'.
  return \Drupal::languageManager()
    ->getCurrentLanguage()
    ->getName();
}