You are here

protected function Vocabulary::validateCustomRoute in Sitemap 8.2

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

Validate the route and argument provided. @TODO Implement for form_save and config import.

Parameters

$string:

File

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

Class

Vocabulary
Provides a sitemap for an taxonomy vocabulary.

Namespace

Drupal\sitemap\Plugin\Sitemap

Code

protected function validateCustomRoute($string) {
  $parts = $this
    ->_splitRouteArg($string);

  /* @var \Drupal\Core\Routing\RouteProviderInterface $route_provider */
  $route_provider = \Drupal::service('router.route_provider');
  try {
    $route = $route_provider
      ->getRouteByName($parts['route']);

    // TODO Determine if $route has the provided $parts['arg'] parameter.
  } catch (\Exception $e) {

    // TODO
  }
}