You are here

public function SitemapController::buildPage in Sitemap 8

Controller for /sitemap.

Return value

array Renderable string.

1 string reference to 'SitemapController::buildPage'
sitemap.routing.yml in ./sitemap.routing.yml
sitemap.routing.yml

File

src/Controller/SitemapController.php, line 46

Class

SitemapController
Controller routines for update routes.

Namespace

Drupal\sitemap\Controller

Code

public function buildPage() {
  $sitemap = [
    '#theme' => 'sitemap',
  ];

  // Check whether to include the default CSS.
  $config = \Drupal::config('sitemap.settings');
  if ($config
    ->get('css') == 1) {
    $sitemap['#attached']['library'] = [
      'sitemap/sitemap.theme',
    ];
  }
  return $sitemap;
}