protected Renderer::replacePlaceholders(array &$elements)
Replaces placeholders.
Placeholders may have:
Also merges the bubbleable metadata resulting from the rendering of the contents of the placeholders. Hence $elements will be contain the entirety of bubbleable metadata.
@returns bool Whether placeholders were replaced.
array &$elements: The structured array describing the data being rendered. Including the bubbleable metadata associated with the markup that replaced the placeholders.
\Drupal\Core\Render\Renderer::renderPlaceholder()
protected function replacePlaceholders(array &$elements) { if (!isset($elements['#attached']['placeholders']) || empty($elements['#attached']['placeholders'])) { return FALSE; } foreach (array_keys($elements['#attached']['placeholders']) as $placeholder) { $elements = $this->renderPlaceholder($placeholder, $elements); } return TRUE; }
© 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!Renderer.php/function/Renderer::replacePlaceholders/8.1.x