You are here

WorkspaceServiceProvider.php in Workspace 8.2

Namespace

Drupal\workspace

File

src/WorkspaceServiceProvider.php
View source
<?php

namespace Drupal\workspace;

use Drupal\Core\DependencyInjection\ContainerBuilder;
use Drupal\Core\DependencyInjection\ServiceProviderBase;

/**
 * Defines a service provider for the workspace module.
 */
class WorkspaceServiceProvider extends ServiceProviderBase {

  /**
   * {@inheritdoc}
   */
  public function alter(ContainerBuilder $container) {

    // Add the 'workspace' cache context as required.
    $renderer_config = $container
      ->getParameter('renderer.config');
    $renderer_config['required_cache_contexts'][] = 'workspace';
    $container
      ->setParameter('renderer.config', $renderer_config);
  }

}

Classes

Namesort descending Description
WorkspaceServiceProvider Defines a service provider for the workspace module.