You are here

public function NgLightboxPass::process in NG Lightbox 2.x

Same name and namespace in other branches
  1. 8 src/NgLightboxPass.php \Drupal\ng_lightbox\NgLightboxPass::process()

File

src/NgLightboxPass.php, line 16

Class

NgLightboxPass
The NgLightboxPass class.

Namespace

Drupal\ng_lightbox

Code

public function process(ContainerBuilder $container) {
  $lightbox_renderers = [];
  foreach ($container
    ->findTaggedServiceIds('render.main_content_renderer') as $id => $attributes_list) {
    foreach ($attributes_list as $attributes) {
      if (!empty($attributes['ng_lightbox'])) {
        $format = $attributes['format'];
        $lightbox_renderers[$format] = $attributes['ng_lightbox'];
      }
    }
  }
  $container
    ->setParameter('ng_lightbox_renderers', $lightbox_renderers);
}