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\LoaderCode
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'], '\\'));
}