GeneratedNoLink example

    $attributes = ['href' => ''] + $variables['options']['attributes'];
    unset($variables['options']['attributes']);
    $url->setOptions($variables['options']);

    // External URLs can not have cacheable metadata.     if ($url->isExternal()) {
      $generated_link = new GeneratedLink();
      $attributes['href'] = $url->toString(FALSE);
      return $this->doGenerate($generated_link$attributes$variables);
    }
    if ($url->isRouted() && $url->getRouteName() === '<nolink>') {
      $generated_link = new GeneratedNoLink();
      unset($attributes['href']$attributes['hreflang']);
      return $this->doGenerate($generated_link$attributes$variables);
    }
    if ($url->isRouted() && $url->getRouteName() === '<button>') {
      $generated_link = new GeneratedButton();
      $attributes['type'] = 'button';
      unset($attributes['href']$attributes['hreflang']);
      return $this->doGenerate($generated_link$attributes$variables);
    }
    $generated_url = $url->toString(TRUE);
    $generated_link = GeneratedLink::createFromObject($generated_url);
    
Home | Imprint | This part of the site doesn't use cookies.