protected function LanguageBlock::blockAccess in Drupal 10
Same name and namespace in other branches
- 8 core/modules/language/src/Plugin/Block/LanguageBlock.php \Drupal\language\Plugin\Block\LanguageBlock::blockAccess()
- 9 core/modules/language/src/Plugin/Block/LanguageBlock.php \Drupal\language\Plugin\Block\LanguageBlock::blockAccess()
File
- core/
modules/ language/ src/ Plugin/ Block/ LanguageBlock.php, line 76
Class
- LanguageBlock
- Provides a 'Language switcher' block.
Namespace
Drupal\language\Plugin\BlockCode
protected function blockAccess(AccountInterface $account) {
$access = $this->languageManager
->isMultilingual() ? AccessResult::allowed() : AccessResult::forbidden();
return $access
->addCacheTags([
'config:configurable_language_list',
]);
}