function PlaceholderingRenderCache::__construct
Same name in other branches
- 9 core/lib/Drupal/Core/Render/PlaceholderingRenderCache.php \Drupal\Core\Render\PlaceholderingRenderCache::__construct()
- 8.9.x core/lib/Drupal/Core/Render/PlaceholderingRenderCache.php \Drupal\Core\Render\PlaceholderingRenderCache::__construct()
- 11.x core/lib/Drupal/Core/Render/PlaceholderingRenderCache.php \Drupal\Core\Render\PlaceholderingRenderCache::__construct()
Constructs a new PlaceholderingRenderCache object.
Parameters
\Symfony\Component\HttpFoundation\RequestStack $request_stack: The request stack.
\Drupal\Core\Cache\VariationCacheFactoryInterface $cache_factory: The variation cache factory.
\Drupal\Core\Cache\Context\CacheContextsManager $cache_contexts_manager: The cache contexts manager.
\Drupal\Core\Render\PlaceholderGeneratorInterface $placeholder_generator: The placeholder generator.
Overrides RenderCache::__construct
File
-
core/
lib/ Drupal/ Core/ Render/ PlaceholderingRenderCache.php, line 86
Class
- PlaceholderingRenderCache
- Adds automatic placeholdering to the RenderCache.
Namespace
Drupal\Core\RenderCode
public function __construct(RequestStack $request_stack, $cache_factory, CacheContextsManager $cache_contexts_manager, PlaceholderGeneratorInterface $placeholder_generator) {
if ($cache_factory instanceof CacheFactoryInterface) {
@trigger_error('Injecting ' . __CLASS__ . ' with the "cache_factory" service is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use "variation_cache_factory" instead. See https://www.drupal.org/node/3365546', E_USER_DEPRECATED);
$cache_factory = \Drupal::service('variation_cache_factory');
}
parent::__construct($request_stack, $cache_factory, $cache_contexts_manager);
$this->placeholderGenerator = $placeholder_generator;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.