function MetadataBubblingUrlGenerator::generateFromRoute

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Render/MetadataBubblingUrlGenerator.php \Drupal\Core\Render\MetadataBubblingUrlGenerator::generateFromRoute()
  2. 10 core/lib/Drupal/Core/Render/MetadataBubblingUrlGenerator.php \Drupal\Core\Render\MetadataBubblingUrlGenerator::generateFromRoute()
  3. 11.x core/lib/Drupal/Core/Render/MetadataBubblingUrlGenerator.php \Drupal\Core\Render\MetadataBubblingUrlGenerator::generateFromRoute()

Overrides UrlGeneratorInterface::generateFromRoute

1 call to MetadataBubblingUrlGenerator::generateFromRoute()
MetadataBubblingUrlGenerator::generate in core/lib/Drupal/Core/Render/MetadataBubblingUrlGenerator.php

File

core/lib/Drupal/Core/Render/MetadataBubblingUrlGenerator.php, line 104

Class

MetadataBubblingUrlGenerator
Decorator for the URL generator, which bubbles bubbleable URL metadata.

Namespace

Drupal\Core\Render

Code

public function generateFromRoute($name, $parameters = [], $options = [], $collect_bubbleable_metadata = FALSE) {
    $generated_url = $this->urlGenerator
        ->generateFromRoute($name, $parameters, $options, TRUE);
    if (!$collect_bubbleable_metadata) {
        $this->bubble($generated_url, $options);
    }
    return $collect_bubbleable_metadata ? $generated_url : $generated_url->getGeneratedUrl();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.