Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. LayoutBuilderEntityViewDisplay.php

function LayoutBuilderEntityViewDisplay::getComponent

Overrides EntityDisplayBase::getComponent

File

core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php, line 493

Class

LayoutBuilderEntityViewDisplay
Provides an entity view display entity that has a layout.

Namespace

Drupal\layout_builder\Entity

Code

public function getComponent($name) {
    if ($this->isLayoutBuilderEnabled() && ($section_component = $this->getSectionComponentForFieldName($name))) {
        $plugin = $section_component->getPlugin();
        if ($plugin instanceof ConfigurableInterface) {
            $configuration = $plugin->getConfiguration();
            if (isset($configuration['formatter'])) {
                return $configuration['formatter'];
            }
        }
    }
    return parent::getComponent($name);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal