function ComponentNegotiator::generateCacheKey

Same name in this branch
  1. 11.x core/lib/Drupal/Core/Theme/ComponentNegotiator.php \Drupal\Core\Theme\ComponentNegotiator::generateCacheKey()
Same name and namespace in other branches
  1. 10 core/modules/sdc/src/ComponentNegotiator.php \Drupal\sdc\ComponentNegotiator::generateCacheKey()

Generates the cache key for the current theme and the provided component.

Parameters

string $component_id: The component ID.

Return value

string The cache key.

1 call to ComponentNegotiator::generateCacheKey()
ComponentNegotiator::negotiate in core/modules/sdc/src/ComponentNegotiator.php
Negotiates the active component for the current request.

File

core/modules/sdc/src/ComponentNegotiator.php, line 170

Class

ComponentNegotiator
Determines which component should be used.

Namespace

Drupal\sdc

Code

private function generateCacheKey(string $component_id) : string {
    return sprintf('sdc-negotiation::%s::%s', $component_id, $this->activeTheme
        ->getName());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.