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

Breadcrumb

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

function Psr4DirectoryLoader::load

Parameters

array{path: string, namespace: string} $resource:

File

vendor/symfony/routing/Loader/Psr4DirectoryLoader.php, line 39

Class

Psr4DirectoryLoader
A loader that discovers controller classes in a directory that follows PSR-4.

Namespace

Symfony\Component\Routing\Loader

Code

public function load(mixed $resource, ?string $type = null) : ?RouteCollection {
    $path = $this->locator
        ->locate($resource['path'], $this->currentDirectory);
    if (!is_dir($path)) {
        return new RouteCollection();
    }
    return $this->loadFromDirectory($path, trim($resource['namespace'], '\\'));
}

API Navigation

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