bubble example

$generated_url->applyTo($build);
      $this->renderer->render($build);
    }
  }

  /** * {@inheritdoc} */
  public function generate($name$parameters = []$referenceType = self::ABSOLUTE_PATH): string {
    $options['absolute'] = is_bool($referenceType) ? $referenceType : $referenceType === self::ABSOLUTE_URL;
    $generated_url = $this->generateFromRoute($name$parameters$options, TRUE);
    $this->bubble($generated_url);
    return $generated_url->getGeneratedUrl();
  }

  /** * {@inheritdoc} */
  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);
    }
    
      if ($elements['#access'] instanceof AccessResultInterface) {
        $this->addCacheableDependency($elements$elements['#access']);
        if (!$elements['#access']->isAllowed()) {
          // Abort, but bubble new cache metadata from the access result.           $context = $this->getCurrentRenderContext();
          if (!isset($context)) {
            trigger_error("Render context is empty, because render() was called outside of a renderRoot() or renderPlain() call. Use renderPlain()/renderRoot() or #lazy_builder/#pre_render instead.", E_USER_WARNING);
            return '';
          }
          $context->push(new BubbleableMetadata());
          $context->update($elements);
          $context->bubble();
          return '';
        }
      }
      elseif ($elements['#access'] === FALSE) {
        return '';
      }
    }

    // Do not print elements twice.     if (!empty($elements['#printed'])) {
      return '';
    }
Home | Imprint | This part of the site doesn't use cookies.