Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. LazyRouteCollection.php

function LazyRouteCollection::get

Gets a route by name.

Parameters

string $name: The route name

Return value

\Symfony\Component\Routing\Route|null A Route instance or null when not found

Overrides RouteCollection::get

File

core/lib/Drupal/Core/Routing/LazyRouteCollection.php, line 60

Class

LazyRouteCollection

Namespace

Drupal\Core\Routing

Code

public function get($name) : ?Route {
    try {
        return $this->provider
            ->getRouteByName($name);
    } catch (RouteNotFoundException) {
        return NULL;
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal