You are here

public function PhpFileLoader::load in Zircon Profile 8.0

Same name in this branch
  1. 8.0 vendor/symfony/routing/Loader/PhpFileLoader.php \Symfony\Component\Routing\Loader\PhpFileLoader::load()
  2. 8.0 vendor/symfony/translation/Loader/PhpFileLoader.php \Symfony\Component\Translation\Loader\PhpFileLoader::load()
  3. 8.0 vendor/symfony/dependency-injection/Loader/PhpFileLoader.php \Symfony\Component\DependencyInjection\Loader\PhpFileLoader::load()
Same name and namespace in other branches
  1. 8 vendor/symfony/routing/Loader/PhpFileLoader.php \Symfony\Component\Routing\Loader\PhpFileLoader::load()

Loads a PHP file.

Parameters

string $file A PHP file path:

string|null $type The resource type:

Return value

RouteCollection A RouteCollection instance

File

vendor/symfony/routing/Loader/PhpFileLoader.php, line 35

Class

PhpFileLoader
PhpFileLoader loads routes from a PHP file.

Namespace

Symfony\Component\Routing\Loader

Code

public function load($file, $type = null) {
  $path = $this->locator
    ->locate($file);
  $this
    ->setCurrentDir(dirname($path));
  $collection = self::includeFile($path, $this);
  $collection
    ->addResource(new FileResource($path));
  return $collection;
}