You are here

public function UrlGenerator::supports in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Routing/UrlGenerator.php \Drupal\Core\Routing\UrlGenerator::supports()

Whether this generator supports the supplied $name.

This check does not need to look if the specific instance can be resolved to a route, only whether the router can generate routes from objects of this class.

Parameters

mixed $name The route "name" which may also be an object or anything:

Return value

bool

Overrides VersatileGeneratorInterface::supports

File

core/lib/Drupal/Core/Routing/UrlGenerator.php, line 437
Contains \Drupal\Core\Routing\UrlGenerator.

Class

UrlGenerator
Generates URLs from route names and parameters.

Namespace

Drupal\Core\Routing

Code

public function supports($name) {

  // Support a route object and any string as route name.
  return is_string($name) || $name instanceof SymfonyRoute;
}