protected function NgLightboxServiceProvider::addLightbox in NG Lightbox 8
Same name and namespace in other branches
- 2.x src/NgLightboxServiceProvider.php \Drupal\ng_lightbox\NgLightboxServiceProvider::addLightbox()
Parameters
\Drupal\Core\DependencyInjection\ContainerBuilder $container:
$id:
$title:
1 call to NgLightboxServiceProvider::addLightbox()
- NgLightboxServiceProvider::alter in src/
NgLightboxServiceProvider.php - Modifies existing service definitions.
File
- src/
NgLightboxServiceProvider.php, line 38 - Contains \Drupal\ng_lightbox\NgLightboxServiceProvider
Class
- NgLightboxServiceProvider
- The NgLightboxServiceProvider class.
Namespace
Drupal\ng_lightboxCode
protected function addLightbox(ContainerBuilder $container, $id, $title) {
$definition = $container
->getDefinition($id);
$tags = $definition
->getTags();
foreach ($tags as $delta => &$tag) {
if ($delta === 'render.main_content_renderer') {
foreach ($tag as &$attribute) {
$attribute['ng_lightbox'] = $title;
}
}
}
$definition
->setTags($tags);
}