function PlaceholderGeneratorInterface::shouldAutomaticallyPlaceholder

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Render/PlaceholderGeneratorInterface.php \Drupal\Core\Render\PlaceholderGeneratorInterface::shouldAutomaticallyPlaceholder()
  2. 10 core/lib/Drupal/Core/Render/PlaceholderGeneratorInterface.php \Drupal\Core\Render\PlaceholderGeneratorInterface::shouldAutomaticallyPlaceholder()
  3. 11.x core/lib/Drupal/Core/Render/PlaceholderGeneratorInterface.php \Drupal\Core\Render\PlaceholderGeneratorInterface::shouldAutomaticallyPlaceholder()

Whether the given render array should be automatically placeholdered.

The render array should be placeholdered if its cacheability either has a cache context with too high cardinality, a cache tag with a too high invalidation rate, or a max-age that is too low. Either of these would make caching ineffective, and thus we choose to placeholder instead.

Parameters

array $element: The render array whose cacheability to analyze.

Return value

bool Whether the given render array's cacheability meets the placeholdering conditions.

1 method overrides PlaceholderGeneratorInterface::shouldAutomaticallyPlaceholder()
PlaceholderGenerator::shouldAutomaticallyPlaceholder in core/lib/Drupal/Core/Render/PlaceholderGenerator.php
Whether the given render array should be automatically placeholdered.

File

core/lib/Drupal/Core/Render/PlaceholderGeneratorInterface.php, line 45

Class

PlaceholderGeneratorInterface
Defines an interface for turning a render array into a placeholder.

Namespace

Drupal\Core\Render

Code

public function shouldAutomaticallyPlaceholder(array $element);

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