protected MetadataBubblingUrlGenerator::bubble(GeneratedUrl $generated_url, array $options = [])
Bubbles the bubbleable metadata to the current render context.
\Drupal\Core\GeneratedUrl $generated_url: The generated URL whose bubbleable metadata to bubble.
array $options: (optional) The URL options. Defaults to none.
protected function bubble(GeneratedUrl $generated_url, array $options = []) { // Bubbling metadata makes sense only if the code is executed inside a // render context. All code running outside controllers has no render // context by default, so URLs used there are not supposed to affect the // response cacheability. if ($this->renderer->hasRenderContext()) { $build = []; $generated_url->applyTo($build); $this->renderer->render($build); } }
© 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!MetadataBubblingUrlGenerator.php/function/MetadataBubblingUrlGenerator::bubble/8.1.x