W3cubDocs

/Drupal 8

public function PlaceholderGeneratorInterface::shouldAutomaticallyPlaceholder

public PlaceholderGeneratorInterface::shouldAutomaticallyPlaceholder(array $element)

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\Render

Code

public function shouldAutomaticallyPlaceholder(array $element);

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Render!PlaceholderGeneratorInterface.php/function/PlaceholderGeneratorInterface::shouldAutomaticallyPlaceholder/8.1.x