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

Breadcrumb

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

function AttributeDirectoryLoader::supports

Overrides AttributeFileLoader::supports

File

vendor/symfony/routing/Loader/AttributeDirectoryLoader.php, line 64

Class

AttributeDirectoryLoader
AttributeDirectoryLoader loads routing information from attributes set on PHP classes and methods.

Namespace

Symfony\Component\Routing\Loader

Code

public function supports(mixed $resource, ?string $type = null) : bool {
    if (!\is_string($resource)) {
        return false;
    }
    if ('attribute' === $type) {
        return true;
    }
    if ($type) {
        return false;
    }
    try {
        return is_dir($this->locator
            ->locate($resource));
    } catch (\Exception) {
        return false;
    }
}

API Navigation

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