You are here

public function SitemapHelper::getTerms in Sitemap 8

Render the latest maps for the taxonomy tree.

Parameters

object $voc: Vocabulary entity.

Return value

array Returns a renderable array for sitemap taxonomies.

File

src/SitemapHelper.php, line 98

Class

SitemapHelper
Defines a helper class for stuff related to views data.

Namespace

Drupal\sitemap

Code

public function getTerms($voc) {
  $output = '';
  $options = [];
  if ($this->moduleHandler
    ->moduleExists('taxonomy') && !empty($voc)) {
    $output = $this
      ->getTaxonomyTree($voc
      ->get('vid'), $voc
      ->get('name'), $voc
      ->get('description'));
    $this
      ->setOption($options, 'show_titles', 1, 'show_titles', TRUE);
  }
  return $output;
}