MainContentRenderersPass.php in Drupal 8
File
core/lib/Drupal/Core/Render/MainContent/MainContentRenderersPass.php
View source
<?php
namespace Drupal\Core\Render\MainContent;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
class MainContentRenderersPass implements CompilerPassInterface {
public function process(ContainerBuilder $container) {
$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);
}
}