public function PlaceholderGeneratorInterface::shouldAutomaticallyPlaceholder in Drupal 10
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Render/PlaceholderGeneratorInterface.php \Drupal\Core\Render\PlaceholderGeneratorInterface::shouldAutomaticallyPlaceholder()
- 9 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.
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\RenderCode
public function shouldAutomaticallyPlaceholder(array $element);