class ConfigurableLanguageRenderer
Same name in other branches
- 9 core/modules/views/src/Entity/Render/ConfigurableLanguageRenderer.php \Drupal\views\Entity\Render\ConfigurableLanguageRenderer
- 8.9.x core/modules/views/src/Entity/Render/ConfigurableLanguageRenderer.php \Drupal\views\Entity\Render\ConfigurableLanguageRenderer
- 10 core/modules/views/src/Entity/Render/ConfigurableLanguageRenderer.php \Drupal\views\Entity\Render\ConfigurableLanguageRenderer
Renders entities in a configured language.
Hierarchy
- class \Drupal\views\Entity\Render\RendererBase implements \Drupal\Core\Cache\CacheableDependencyInterface
- class \Drupal\views\Entity\Render\EntityTranslationRendererBase extends \Drupal\views\Entity\Render\RendererBase
- class \Drupal\views\Entity\Render\ConfigurableLanguageRenderer extends \Drupal\views\Entity\Render\EntityTranslationRendererBase
- class \Drupal\views\Entity\Render\EntityTranslationRendererBase extends \Drupal\views\Entity\Render\RendererBase
Expanded class hierarchy of ConfigurableLanguageRenderer
File
-
core/
modules/ views/ src/ Entity/ Render/ ConfigurableLanguageRenderer.php, line 13
Namespace
Drupal\views\Entity\RenderView source
class ConfigurableLanguageRenderer extends EntityTranslationRendererBase {
/**
* A specific language code for rendering if available.
*
* @var string|null
*/
protected $langcode;
/**
* Constructs a renderer object.
*
* @param \Drupal\views\ViewExecutable $view
* The entity row being rendered.
* @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
* The language manager.
* @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
* The entity type.
* @param string|null $langcode
* A specific language code to set, if available.
*/
public function __construct(ViewExecutable $view, LanguageManagerInterface $language_manager, EntityTypeInterface $entity_type, $langcode) {
parent::__construct($view, $language_manager, $entity_type);
$this->langcode = $langcode;
}
/**
* {@inheritdoc}
*/
public function getLangcode(ResultRow $row) {
return $this->langcode;
}
}
Members
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.