public function LangcodeTrait::setLangcode in Coder 8.2
Same name and namespace in other branches
- 8.3 tests/DrupalPractice/good/good.php \LangcodeTrait::setLangcode()
- 8.3.x tests/DrupalPractice/good/good.php \LangcodeTrait::setLangcode()
Select language.
Parameters
string $langcode: Language code.
Return value
$this Current instance.
1 call to LangcodeTrait::setLangcode()
- LangcodeTrait::getLangcode in coder_sniffer/
DrupalPractice/ Test/ good/ good.php - Get code of currently active language.
File
- coder_sniffer/
DrupalPractice/ Test/ good/ good.php, line 103
Class
- LangcodeTrait
- A trait containing helper methods for language handling.
Code
public function setLangcode($langcode) {
$this->langcode = $langcode;
$this->lang = \Drupal::languageManager()
->getLanguage($this->langcode);
return $this;
}