public function NgLightbox::__construct in NG Lightbox 2.x
Same name and namespace in other branches
- 8 src/NgLightbox.php \Drupal\ng_lightbox\NgLightbox::__construct()
Constructs a new NgLightbox service.
Parameters
\Drupal\Core\Path\PathMatcherInterface $path_matcher: Patch matcher services for comparing the lightbox patterns.
\Drupal\path_alias\AliasManagerInterface $alias_manager: Alias manager so we can also test path aliases. The Path Alias core subsystem has been moved to the "path_alias" module [https://www.drupal.org/node/3092086].
\Drupal\Core\Config\ConfigFactoryInterface $config_factory: The config factory so we can get the lightbox settings.
\Drupal\Core\Routing\AdminContext $admin_context: Provides a helper class to determine whether the route is an admin one.
File
- src/
NgLightbox.php, line 70
Class
- NgLightbox
- Provides a Service Class for NgLightbox.
Namespace
Drupal\ng_lightboxCode
public function __construct(PathMatcherInterface $path_matcher, AliasManagerInterface $alias_manager, ConfigFactoryInterface $config_factory, AdminContext $admin_context) {
$this->pathMatcher = $path_matcher;
$this->aliasManager = $alias_manager;
$this->config = $config_factory
->get('ng_lightbox.settings');
$this->adminContext = $admin_context;
}