function YamlRouteDiscovery::getRouteDefinitions

Same name and namespace in other branches
  1. main core/lib/Drupal/Core/Routing/YamlRouteDiscovery.php \Drupal\Core\Routing\YamlRouteDiscovery::getRouteDefinitions()

Retrieves all defined routes from .routing.yml files.

Return value

array The defined routes, keyed by provider.

1 call to YamlRouteDiscovery::getRouteDefinitions()
YamlRouteDiscovery::collectRoutes in core/lib/Drupal/Core/Routing/YamlRouteDiscovery.php
Creates a collection of routes to add to the route builder.
1 method overrides YamlRouteDiscovery::getRouteDefinitions()
TestYamlRouteDiscovery::getRouteDefinitions in core/tests/Drupal/Tests/Core/Routing/RouteBuilderTest.php
Retrieves all defined routes from .routing.yml files.

File

core/lib/Drupal/Core/Routing/YamlRouteDiscovery.php, line 90

Class

YamlRouteDiscovery
Reads routing.yml files provided by modules and creates route collections.

Namespace

Drupal\Core\Routing

Code

protected function getRouteDefinitions() {
  // Always instantiate a new YamlDiscovery object so that we always search on
  // the up-to-date list of modules.
  $discovery = new YamlDiscovery('routing', $this->moduleHandler
    ->getModuleDirectories());
  return $discovery->findAll();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.