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

Breadcrumb

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

class MainContentRenderersPass

Adds main_content_renderers parameter to the container.

Hierarchy

  • class \Drupal\Core\Render\MainContent\MainContentRenderersPass implements \Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface

Expanded class hierarchy of MainContentRenderersPass

1 file declares its use of MainContentRenderersPass
CoreServiceProvider.php in core/lib/Drupal/Core/CoreServiceProvider.php

File

core/lib/Drupal/Core/Render/MainContent/MainContentRenderersPass.php, line 11

Namespace

Drupal\Core\Render\MainContent
View source
class MainContentRenderersPass implements CompilerPassInterface {
    
    /**
     * {@inheritdoc}
     *
     * Collects the available main content renderer service IDs into the
     * main_content_renderers parameter, keyed by format.
     */
    public function process(ContainerBuilder $container) : void {
        $main_content_renderers = [];
        foreach ($container->findTaggedServiceIds('render.main_content_renderer') as $id => $attributes_list) {
            foreach ($attributes_list as $attributes) {
                $format = $attributes['format'];
                $main_content_renderers[$format] = $id;
            }
        }
        $container->setParameter('main_content_renderers', $main_content_renderers);
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
MainContentRenderersPass::process public function Collects the available main content renderer service IDs into the
main_content_renderers parameter, keyed by format.
Overrides CompilerPassInterface::process

API Navigation

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