W3cubDocs

/Drupal 8

public function 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);

© 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::createPlaceholder/8.1.x