You are here

protected function Vocabulary::buildLink in Sitemap 2.0.x

Same name and namespace in other branches
  1. 8.2 src/Plugin/Sitemap/Vocabulary.php \Drupal\sitemap\Plugin\Sitemap\Vocabulary::buildLink()

Build the URL given a route|arg pattern.

Parameters

string $string:

int $tid:

Return value

string

2 calls to Vocabulary::buildLink()
Vocabulary::buildFeedLink in src/Plugin/Sitemap/Vocabulary.php
Builds the taxonomy term feed link.
Vocabulary::buildTermLink in src/Plugin/Sitemap/Vocabulary.php
Builds the taxonomy term link.

File

src/Plugin/Sitemap/Vocabulary.php, line 453

Class

Vocabulary
Provides a sitemap for an taxonomy vocabulary.

Namespace

Drupal\sitemap\Plugin\Sitemap

Code

protected function buildLink($string, $tid) {
  $parts = $this
    ->_splitRouteArg($string);
  return Url::fromRoute($parts['route'], [
    $parts['arg'] => $tid,
  ])
    ->toString();
}