You are here

public static function Language::getValue in Config Pages 8

Same name and namespace in other branches
  1. 8.3 src/Plugin/ConfigPagesContext/Language.php \Drupal\config_pages\Plugin\ConfigPagesContext\Language::getValue()
  2. 8.2 src/Plugin/ConfigPagesContext/Language.php \Drupal\config_pages\Plugin\ConfigPagesContext\Language::getValue()

Return the value of the context.

Return value

mixed

Overrides ConfigPagesContextBase::getValue

File

src/Plugin/ConfigPagesContext/Language.php, line 22

Class

Language
Provides a language config pages context.

Namespace

Drupal\config_pages\Plugin\ConfigPagesContext

Code

public static function getValue() {
  $lang = \Drupal::service('language_manager')
    ->getCurrentLanguage();
  return $lang
    ->getId();
}