PlaceholderGeneratorInterface::createPlaceholder

public PlaceholderGeneratorInterface::createPlaceholder(array $element)

Turns the given element into a placeholder.

Placeholdering allows us to avoid "poor cacheability contamination": this maps the current render array to one that only has #markup and #attached, and #attached contains a placeholder with this element's prior cacheability metadata. In other words: this placeholder is perfectly cacheable, the placeholder replacement logic effectively cordons off poor cacheability.

Parameters

array $element: The render array to create a placeholder for.

Return value

array Render array with placeholder markup and the attached placeholder replacement metadata.

File

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

Class

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

Namespace

Drupal\Core\Render

Code

public function createPlaceholder(array $element);
doc_Drupal
2016-10-29 09:34:10
Comments
Leave a Comment

Please login to continue.