function UrlGenerator::getRouteStringIdentifier

Gets either the route name or a string based on the route object.

@todo Remove in https://www.drupal.org/project/drupal/issues/3339710

@internal

Parameters

string|\Symfony\Component\Routing\Route $name: A string route name, or a serializable object.

Return value

string Either the route name, or a string that uniquely identifies the route.

2 calls to UrlGenerator::getRouteStringIdentifier()
UrlGenerator::generateFromRoute in core/lib/Drupal/Core/Routing/UrlGenerator.php
UrlGenerator::getPathFromRoute in core/lib/Drupal/Core/Routing/UrlGenerator.php

File

core/lib/Drupal/Core/Routing/UrlGenerator.php, line 461

Class

UrlGenerator
Generates URLs from route names and parameters.

Namespace

Drupal\Core\Routing

Code

private function getRouteStringIdentifier(string|SymfonyRoute $name) : string {
    if (is_scalar($name)) {
        return $name;
    }
    if ($name instanceof SymfonyRoute) {
        return 'Route with pattern ' . $name->getPath();
    }
    return serialize($name);
}

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