class DomainServiceProvider in Domain Access 8
Overrides the router.route_provider service.
Point to our customized one and adds url.site to the required_cache_contexts renderer configuration.
Hierarchy
- class \Drupal\Core\DependencyInjection\ServiceProviderBase implements ServiceModifierInterface, ServiceProviderInterface
- class \Drupal\domain\DomainServiceProvider implements ServiceModifierInterface
Expanded class hierarchy of DomainServiceProvider
See also
https://www.drupal.org/node/2662196#comment-10838164
File
- domain/
src/ DomainServiceProvider.php, line 17
Namespace
Drupal\domainView source
class DomainServiceProvider extends ServiceProviderBase implements ServiceModifierInterface {
/**
* {@inheritdoc}
*/
public function alter(ContainerBuilder $container) {
// Add the site context to the render cache.
if ($container
->hasParameter('renderer.config')) {
$renderer_config = $container
->getParameter('renderer.config');
if (!in_array('url.site', $renderer_config['required_cache_contexts'])) {
$renderer_config['required_cache_contexts'][] = 'url.site';
}
$container
->setParameter('renderer.config', $renderer_config);
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DomainServiceProvider:: |
public | function |
Modifies existing service definitions. Overrides ServiceProviderBase:: |
|
ServiceProviderBase:: |
public | function |
Registers services to the container. Overrides ServiceProviderInterface:: |
1 |